ui-uploader not supported additional parameters to the upload POST request.
Variable named "data" is declared in the beginning og "ajaxUpload" function.
function ajaxUpload(file, url) {
var xhr, formData, prop, data = '',
key = '' || 'file';
Later on in this function, there is a code that check if data not empty, to add all its properties to the formData object as request parameters (POST variables...)
// Append additional data if provided:
if (data) {
for (prop in data) {
if (data.hasOwnProperty(prop)) {
formData.append(prop, data[prop]);
}
}
}
But there is no way to populate this variable with data (the if statement in the previous example will never evaluate as "true").
As a result, the only way to add parameters to the upload request is using the query string (changing the URL) instead of using request body.
The solution (without breaking backword compitability) is to add 3rd argument "data" to "ajaxUpload". This argument is populated from "options.data".
ui-uploader not supported additional parameters to the upload POST request.
Variable named "data" is declared in the beginning og "ajaxUpload" function.
Later on in this function, there is a code that check if data not empty, to add all its properties to the formData object as request parameters (POST variables...)
But there is no way to populate this variable with data (the if statement in the previous example will never evaluate as "true").
As a result, the only way to add parameters to the upload request is using the query string (changing the URL) instead of using request body.
The solution (without breaking backword compitability) is to add 3rd argument "data" to "ajaxUpload". This argument is populated from "options.data".