在 Flash 或 Silverlight 的 ASP.NET 中上传文件夹
有没有办法在asp.net中上传整个文件夹(一个文件夹)?
有什么方法可以在 Flash 或 Silverlight 中上传吗?
Is there any way to upload entire folder (a folder) in asp.net?
Is there any way to upload in Flash or Silverlight?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用 Flash(也可能是 Silverlight)选择要上传的文件夹中的所有文件,但不能选择文件夹或递归文件夹。
这是一个使用 flash 作为视觉前端的示例:
http://www.codeproject.com/KB/aspnet/FlashUpload.aspx
下面是一个使用 Flash 进行多个文件上传并使用 JQuery 进行视觉效果的示例:
http://www.uploadify.com/demo/
为了实现选择您需要的文件夹构建对操作系统有更多控制权的 ActiveX 控件或 Java Applet。
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.
AFAIK,您无法上传整个文件夹(至少在闪存中)。您可以使用 FileReference 类上传单个文件在闪光中。
AFAIK, you cannot upload an entire folder (in flash at least). You can upload a single file using the FileReference class in flash.
Sourceforge 上的 JUpload 项目 有一个方便的开源实现,可以满足您正在寻找的内容。这是一个演示。
但在我看来,与仅基于文件的 js/flash 上传器相比,这是一场 UI 噩梦……小程序太慢且笨重,无法在现代网站中找到一席之地。
尽管存在安全问题,但允许访问用户系统的批准框不会激发对您的应用程序的任何信任。对于普通人来说,如果他们能够轻松上传几个文件,为什么他们要面对一个奇怪的文件夹对话框呢?
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?