plupload - 使用上传的文件发送另一个请求参数
plupload 在 文件对象。如何将此 id 发送到上传脚本? 上传脚本在 $_POST
中有 3 个变量 - 文件名、块编号和块总数。
如何向 plupload 的 POST 请求添加另一个参数(在我的例子中是 file.id)?
plupload creates nice ids in file object. How this id can be sent to the upload script?
The upload script has 3 variables in $_POST
- file name, chunk number and total number of chunks.
How to add another parameter to plupload's POST request (in my case, the file.id)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
第一步是向
BeforeUpload
事件添加一个处理程序。然后,如果您使用 multipart,您可以更改上传器设置以动态设置不同的 multipart 参数:(
警告:此示例覆盖所有 multipart_params,您可以通过设置 fileid 来更智能地播放它)
如果您不使用 multipart ,您唯一的选择是将参数作为标头传递,或者手动将参数添加到每个文件的 URL(这两个选项也应该在 BeforeUpload 中完成)。
请注意,当不使用 multipart 时,plupload 会将
name
和chunk
参数添加到 URL 您已为上传器设置的任何 URL 之后,例如每个文件,所以这就是额外参数所在的地方。The first step would be to add a handler to the
BeforeUpload
event.Then, if you are using multipart, you can change the uploader settings to dynamically set different multipart params:
(warning: this example overrides any and all multipart_params, you can play it smarter than that by just setting fileid)
if you are not using multipart, your only options would be to pass the argument as a header, or to manually add the param to the URL for each file (these 2 options should also be done within BeforeUpload).
Note that when not using multipart, plupload will add the
name
andchunk
params to the URL after any URL you already set for the uploader, for each file, so this is where extra params go.