select multiple files to upload in ASP.NET (preferably without flash)

假如想象 提交于 2019-12-30 11:35:44

问题


is there a solution that allows to select multiple files from the file open dialog box and upload them from ASP.NET web page? I have gone through previous posts related to this, but wondering if it is possible to select multiple files for upload without using the technologies like flash or silverlight? thanks in advance.

UPDATE: to be clear, I need to select multiple files in a folder in the dialog box at once, by pressing shift or control key. the flash upload controls allow this, but I am looking for one without flash. it looks like this is a limitation and not possible without using flash or activex controls.


回答1:


It's possible with HTML5 which gives the standard input tag for files an additional attribute: multiple.

When implemented, it looks like this:

<input type="file" id="input" multiple="true" />

...and give you exactly what you're looking for.

If you toss in some vanilla Javascript, you can even stream the upload of the file(s).

http://blog.new-bamboo.co.uk/2010/7/30/html5-powered-ajax-file-uploads

The 2 downsides are:

  1. This only works with browsers that respect HTML5 (FF/Chrome/Opera/Safari). You still need a solution for flavors of IE.
  2. The example shown indicates how to deal with the streamed file in PHP/Ruby/Django environments. You'll have to figure out how to read the uploaded file deal with this in a .Net way.

I hope this helps or at least puts you on the right path.




回答2:


Maybe jQuery can help you out, for example http://docs.jquery.com/Tutorials:Multiple_File_Upload_Magic

If you Google there are allot of jQuery uploaders, not sure if they use flash, but you can try it out

edit: http://valums.com/ajax-upload this one allowed multiple file uploads

  • multiple file select in FF, Chrome, Safari
  • progress-bar in FF, Chrome6+, Safari
  • drag-and-drop file select in FF, Chrome
  • stylable via CSS
  • uploads are cancellable
  • no external dependencies
  • doesn't use Flash
  • fully working with https
  • keyboard support in FF, Chrome, Safari
  • supports IE6-8, Firefox 3-4beta, Safari4-5, Chrome, Ope


来源:https://stackoverflow.com/questions/3550154/select-multiple-files-to-upload-in-asp-net-preferably-without-flash

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