3

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!

braX
  • 11,506
  • 5
  • 20
  • 33
eidylon
  • 7,068
  • 20
  • 75
  • 118

4 Answers4

6

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

tvanfosson
  • 524,688
  • 99
  • 697
  • 795
  • Ah, thanks for that. I missed that at the bottom of the page down there. Unfortunately it doesn't seem to work... even though my selector does return items. Ah well, on to something else. – eidylon Dec 10 '09 at 00:57
1
$("input[type=file]").wrap("<div id='fileWrapper'/>");
$("#fileWrapper").append("<div id='duplicateFile' style='display:none'>"+$("#fileWrapper").html()+"</div>");
$("#fileWrapper").html($("#duplicateFile").html());
Niraj
  • 11
  • 2
0

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!

eidylon
  • 7,068
  • 20
  • 75
  • 118
-1

This also works..

$('.MultiFile-list').find('a').click();
Taryn
  • 242,637
  • 56
  • 362
  • 405
Arul
  • 1