开发者

jQuery MultiFile - how to clear / reset?

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 exampl开发者_高级运维es though a way to "reset" the file-picker, clearing out any currently selected items.

Any one know how to do this? Thanks!


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')


$("input[type=file]").wrap("<div id='fileWrapper'/>");
$("#fileWrapper").append("<div id='duplicateFile' style='display:none'>"+$("#fileWrapper").html()+"</div>");
$("#fileWrapper").html($("#duplicateFile").html());


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!


This also works..

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜