简体   繁体   English

如何向使用plupload库上传的文件添加信息?

[英]How can I add information to file that uploaded with plupload library?

 $('.plupload').pluploadQueue({ runtimes: 'html5,gears,flash,browserplus', url: '/uploads/upload?_id=' + $('#fax_id').val(), max_file_size: '100mb', chunk_size: '1mb', sortable: true, filters: [{ title: "Image File", extensions: "jpg,gif,png,jpeg,tiff,tif,bmp" }, { title: "Document File", extensions: "pdf,xls,xlsx,ppt,pptx,doc,docx,txt,rtf" } ], flash_swf_url: 'js/plupload/plupload.flash.swf', silverlight_xap_url: 'js/plupload/plupload.silverlight.xap', init: { FileUploaded: function(up, file, info) {}, Error: function(up, args) { return false; } } }); 

I wanted to upload a file with using plupload library. 我想使用plupload库上传文件。 And also some text must be added to the uploaded file. 并且还必须将一些文本添加到上传的文件中。 Is it possible? 可能吗? Thank you in advance. 先感谢您。

You can use multipart_params to pass additional fields along with each upload request. 您可以使用multipart_params与每个上载请求一起传递其他字段。

$('.plupload').pluploadQueue({
  ...
  multipart_params: {
    data: 'This is a text'
  }
});

More Info: 更多信息:
https://www.plupload.com/docs/v2/Options#multipart https://www.plupload.com/docs/v2/Options#multipart_params https://www.plupload.com/docs/v2/Options#multipart https://www.plupload.com/docs/v2/Options#multipart_params

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM