Multiple file uploads via Javascript/Ajax?

2019-08-29 06:48发布

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.

4条回答
Summer. ? 凉城
2楼-- · 2019-08-29 07:11

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

查看更多
3楼-- · 2019-08-29 07:25

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

查看更多
家丑人穷心不美
4楼-- · 2019-08-29 07:31

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

查看更多
走好不送
5楼-- · 2019-08-29 07:31

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

EDIT: Added an exclamation point.

查看更多
登录 后发表回答