通过Javascript/Ajax可以上传多个文件吗? [英] Multiple file uploads via Javascript/Ajax?
问题描述
当用户单击浏览"按钮时,是否可以选择一个以上的文件进行上传,并在不刷新页面的情况下上传这些文件?
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?
这在Gmail中会发生,当您单击以附加文件时,您可以按住CTRL键并选择多个文件.
This happens in Gmail, when you click to attach a file you can hold down CTRL and select multiple files.
推荐答案
我最近遇到了类似的问题.我们一直在使用Uploadify(http://www.uploadify.com/)进行上传.我写了一篇有关如何使用Uploadify执行多个文件上传的博客文章:
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/
有两个受支持的选项:
-
使用单个"input"元素并选择多个文件.
Use a single 'input' element and select multiple files.
使用多个输入"元素来分别选择一个文件.
Use multiple 'input' elements to select a single file each.
希望这会有所帮助.
鲍勃
这篇关于通过Javascript/Ajax可以上传多个文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!