jQuery MultiFile - 如何清除/重置?

发布于 2024-08-13 22:04:46 字数 265 浏览 1 评论 0原文

我正在使用此处的 jQuery 多文件上传插件:
http://www.fyneworks.com/jquery/multiple-file-upload/< /a>

我在任何示例中都没有看到“重置”文件选择器的方法, 清除所有当前选定的项目。

有人知道该怎么做吗? 谢谢!

I'm using the jQuery multi-file upload plugin found here:
http://www.fyneworks.com/jquery/multiple-file-upload/

I don't see in any of the examples though a way to "reset" the file-picker,
clearing out any currently selected items.

Any one know how to do this?
Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

呢古 2024-08-20 22:04:46

来自下载中包含的文档。还在 上传 文档页面上注明(滚动到底部, AJAX 下)。

如何重置控件?

要重置文件选择,只需进行以下调用:

$('输入:文件').MultiFile('重置')

From the documentation included in the download. Also noted on the Upload documentation page (scroll to bottom, under AJAX).

How do I reset the control?

To reset the file selections, just make the following call:

$('input:file').MultiFile('reset')

謸气贵蔟 2024-08-20 22:04:46
$("input[type=file]").wrap("<div id='fileWrapper'/>");
$("#fileWrapper").append("<div id='duplicateFile' style='display:none'>"+$("#fileWrapper").html()+"</div>");
$("#fileWrapper").html($("#duplicateFile").html());
$("input[type=file]").wrap("<div id='fileWrapper'/>");
$("#fileWrapper").append("<div id='duplicateFile' style='display:none'>"+$("#fileWrapper").html()+"</div>");
$("#fileWrapper").html($("#duplicateFile").html());
眼趣 2024-08-20 22:04:46

对于任何感兴趣的人,我在此处上传了我的多文件
我最终推出了自己的插件,因为我无法让这个插件工作。

我必须从特定于客户端的文件中剔除很多内容,但文件上传的重要内容都应该在那里。我没有包含用于解析表单提交的上传库,只是包含用于创建多文件上传 UI 的客户端代码。一切均按原样提供。

希望它可以帮助别人!

For anyone interested, I uploaded my multi-file here.
I wound up rolling my own, because I could not get this plug-in to work.

I had to cull a lot out of the file that was specific to the client, but the important stuff for the file upload should all be there. I did NOT include the upload library for parsing the form submission, just the client code for creating a multi-file upload UI, for what it is. It's all provided as is.

Hope it may help somebody!

筱武穆 2024-08-20 22:04:46

这也行..

$('.MultiFile-list').find('a').click();

This also works..

$('.MultiFile-list').find('a').click();
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文