刷新 plupload
我正在使用 plupload。
传输队列完成后如何重置上传器,以便用户可以根据需要上传更多文件?
I'm using plupload.
How do you reset the uploader after the transfer queue completes, so the user can upload more files if they want?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
uploader.splice(); 将从队列中删除所有文件并使上传器对象准备好重新开始。
uploader.splice();
will remove all files from the queue and make uploader object ready to start over.按照这个顺序...适用于 jquery.ui 模式。
In that sequence... Works on jquery.ui mode.
现在有一个选项可以在上传完成后自动重置队列小部件。
http://www.plupload.com/documentation.php
There is now an option to automatically reset the queue widget once uploads are complete.
http://www.plupload.com/documentation.php
jayarjo 的解决方案会从上传器中删除文件,但不会恢复“添加/上传”按钮。
这个有效...
http://www.plupload.com/punbb /viewtopic.php?pid=1360#p1360
jayarjo's solution removes the files from the uploader, but doesn't restore the Add/upload buttons.
This one works...
http://www.plupload.com/punbb/viewtopic.php?pid=1360#p1360
在此序列中:
我使用的函数正在使用其他一些内容重置表单,但无法重置 plupload。我不介意它不会再次出现“拖动文件”文本,尽管我认为它可以被猴子操纵。它可能与计数有关。例如,我有这些参数:
也许删除这些输入不是一个好主意,但是将它们恢复到初始状态可以工作..我会调查这一点并随着它的发展回来..感谢您的好建议。
In this sequence:
I'm using a function that was resetting the form with some other content but was unable to reset plupload. I don;t mind that it does not come again the Drag Files here text, although I think that it can be monkeyed.. It might have something to do with the count. For instance, I have these params:
Perhaps removing these inputs is not a good idea, but restoring them to their initial state could work.. I will look into that and come back as it develops.. Thanks for the nice advices.
我绑定到 UploadComplete 事件,以便在上传完成时删除并重新初始化 plupload 对象。事实证明,这对我来说是最好的实现。
通过此实现,只需调用 init_uploader() 进行初始化 - 在本例中,在 jquery 页面加载完成时。
HTML:
JavaScript:
I bind to the UploadComplete event to remove and re-initialize the plupload object when the upload completes. It turned out to be the best implementation for me.
With this implementation, just call init_uploader() to initialize- in this case, on jquery page load complete.
HTML:
Javascript: