Multiple file uploads via Javascript/Ajax?

柔情痞子 提交于 2020-01-25 08:33:24

问题


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.



来源:https://stackoverflow.com/questions/5553288/multiple-file-uploads-via-javascript-ajax

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!