Multiple file uploads via Javascript/Ajax?

2019-08-29 06:49发布

问题:

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.

回答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



回答2:

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



回答3:

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



回答4:

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

EDIT: Added an exclamation point.