Closed zheplusplus closed 9 years ago
Thanks for tying the plugin!
Yeah, its an issue that also other people are having as well.
First use the dmuploader.js / dmuploader.min.js from the Git repo, i just commited a small tweak to the code; and then use something like this:
onBeforeUpload: function() {
$('#drag-and-drop-zone').data('dmUploader').settings.extraData = {
someField: $('#some-input').val()
};
}
Not a big fan of this, but it will get the job done until the new version is released with a proper solution for these kind of issues.
Cheers!
Thanks for tying the plugin!
Yeah, its an issue that also other people are having as well.
First use the dmuploader.js / dmuploader.min.js from the Git repo, i just commited a small tweak to the code; and then use something like this:
onBeforeUpload: function() { $('#drag-and-drop-zone').data('dmUploader').settings.extraData = { someField: $('#some-input').val() }; }
Not a big fan of this, but it will get the job done until the new version is released with a proper solution for these kind of issues.
Cheers!
Found the fix for this. Right after the setup, store the instance to a variable for later use.
On the next upload, direct access the extraData
provided from the settings
dnd.data('dmUploader').settings.extraData = extraData
That should dynamically add any extra payloads on your subsequent requests!
hi, thanks for your work.
Is it possible to set
extraData
just before upload? Like this