Unable to pass additional parameters in plupload

六月ゝ 毕业季﹏ 提交于 2019-11-27 05:31:43

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)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!