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

后端 未结 2 1764
忘了有多久
忘了有多久 2021-01-16 03:47

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 t

2条回答
  •  醉梦人生
    2021-01-16 04:14

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

    When implemented, it looks like this:

    
    

    ...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.

提交回复
热议问题