Upload a folder in ASP.NET of Flash or Silverlight

2020-02-11 16:05发布

问题:

Is there any way to upload entire folder (a folder) in asp.net?

Is there any way to upload in Flash or Silverlight?

回答1:

You can use Flash (and probably Silverlight) to select all the files in a folder to upload, however you cannot select a folder or recurse folders.

Here is an exmaple that uses flash as the visual front end: http://www.codeproject.com/KB/aspnet/FlashUpload.aspx

Here is an example that uses flash for the multiple file upload by uses JQuery for the visuals: http://www.uploadify.com/demo/

In order to achieve selecting folders you will need to build an ActiveX control or Java Applet which has a lot more control over the operating system.



回答2:

AFAIK, you cannot upload an entire folder (in flash at least). You can upload a single file using the FileReference class in flash.



回答3:

The JUpload project on Sourceforge has a handy open source implementation of what you're looking for. Here's a demo.

But IMO this is a UI nightmare compared to file-only js / flash based uploaders... applets are far too slow and clunky to find a place in modern websites.

And that approval box to allow access to the user's system is not going to inspire any trust in your application, notwithstanding the security concerns. As far as the average joe is concerned, if they're able to upload a few files without hassle, why should they have to face a strange dialog box for a folder?