I'm using plupload, the JQuery UI implementation. I'm trying to pass additional parameters to the server, but I can't make it work. It should be pretty straightforward, the parameters are already set when the function is executed, so that should not be a problem. I've tried this:
I've also tried to add this in the $('form').submit section:
uploader.bind('BeforeUpload', function(up) { up.settings.multipart_params = { 'ordre': ordreibruk, 'mode': m }; });
But to no avail.
I'm sure I'm overlooking something really simple, but what?
Kind regards, Anders
I must confess I use to put my parameters as query string parameters in the url :
- during init :
url: '/upload.aspx?id='+Id,
- or later :
upldr.settings.url = upldr.settings.url + '&token=' + myToken;
It works fine. Hope this will help
Had the same issue. Stumbled upon this snippet that can easily translated into coffescript as well that works for my project. Allows you to pass multipart params after initialization (like in the case a field can change before the upload is hit)
var myUploader = $('#uploader').plupload('getUploader'); myUploader.bind('BeforeUpload', function(up, file) { up.settings.multipart_params = {path : $("#path").val()}; });
Call it after you do your normal initialize and setup of $("#divOpplaster").plupload(...) (and set your ID appropriately to your uploader field, of course)