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.

    Demo

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

    Code

    <!-- 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>
        </select>
    </form>
    
    <!--element -->
    <textarea id="content"></textarea>
    
    <!-- call -->
    <script>
    $R('#content', {
        imageUpload: '/your-upload-script/',
        imageData: {
            id: 10,
            elements: '#my-input, #my-form'
        }
    });
    </script>