Additional upload data

This example shows how to send an additional data as POST params with uploading images or files. Just set the imageData or fileData object with some params.

This input and form will be send with uploading image as POST params.


<!-- additional data -->
<input type="text" id="my-input" name="my-input" value="my input data">
<form id="my-form">
    <input type="text" name="form-input" value="my form input data">
    <select name="form-select">
        <option value="my form select data">Selected item</option>

<!--element -->
<textarea id="content"></textarea>

<!-- call -->
$R('#content', {
    imageUpload: '/your-upload-script/',
    imageData: {
        id: 10,
        elements: '#my-input, #my-form'