0

Is there a way to select more than one files to upload when a user clicks the 'Browse' button, and have those files uploaded without refreshing the page?

This happens in Gmail, when you click to attach a file you can hold down CTRL and select multiple files.

Ali
  • 261,656
  • 265
  • 575
  • 769
  • 1
    What do you get returned from the file select dialog? If it's a collection (or some sort of delimited list, you can transform into a collection) you can iterate through it generating multiple requests. – StuperUser Apr 05 '11 at 14:17
  • Gmail uses flash. I don't think this is possible with the standard Html file select element. – kgiannakakis Apr 05 '11 at 14:19

4 Answers4

1

there are only two ways of uploading a file without refreshing the page:

  1. iframe

  2. flash - it will give you the possibility to select multiple files at once

look at SWFUpload for more info

Teneff
  • 30,564
  • 13
  • 72
  • 103
1

I recently faced a similar problem. We had been using Uploadify (http://www.uploadify.com/) to do uploads. I wrote a blog post on how to use Uploadify to perform multiple file uploads:

http://blog.bobcravens.com/2011/03/upload-multiple-files-with-progress-using-uploadify/

There are a couple of supported options:

  • Use a single 'input' element and select multiple files.

  • Use multiple 'input' elements to select a single file each.

Hope this helps.

Bob

rcravens
  • 8,320
  • 2
  • 33
  • 26
  • Is there any way to keep that queue list with progress bars from appearing? Instead of that I want to implement my own queue list. I think I do that using the OnSelect event, but how to keep the default queue list from appearing? – Ali Apr 05 '11 at 14:39
  • 1
    Those appear to be wrapped in a div with the following class 'uploadifyQueue'. You may be able to add a display:none style to that class. I haven't tried this. – rcravens Apr 05 '11 at 15:09
  • Using the Jquery console in Chrome, setting the display to none works on hiding that queue.. thanks! Should most likely work live too. I'll give it a try – Ali Apr 05 '11 at 22:42
  • Feel free to post this to my other question too and I'll accept in both places if this works. http://stackoverflow.com/questions/5553226/ajax-based-file-uploads – Ali Apr 05 '11 at 23:21
0

Check http://valums.com/ajax-upload/ it's a neat plugin!

EDIT: Added an exclamation point.

John Strickler
  • 25,151
  • 4
  • 52
  • 68
0

If you want some that is really cross-platform use: plupload it support HTML4, 5, Flash, and much more...

MiPnamic
  • 1,257
  • 10
  • 18