将文件夹上传到网站的最佳方法是什么? [英] What is the best way to upload a folder to a website?

查看:233
本文介绍了将文件夹上传到网站的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个简单的方法来允许用户一次上传多个文件(即我需要允许用户上传文件夹)。我不希望把压缩的负担放在用户身上。



如果可能的话,我宁愿避免使用Flash或变体。请注意,这排除了答案:什么是最好的客户端浏览器库上传多个文件通过HTTP? / a>。

只用HTML和Javascript就无法做到这一点。我建议尝试 Fancy Upload MooTools 插件用于多文件上传。它使用JavaScript和Flash的混合,但优雅地降级。它适用于包括IE6在内的所有主流浏览器,还有一个兼容Flash 10的版本可供下载(尽管该演示还未更新)。






更新(2012-11-26):

可以使用 https://github.com/valums/file-uploaderrel =nofollow noreferrer> valums blueimp 文件上传。



对于递归目录上传,您最好的解决方案是使用 Chrome 11的新的文件夹上传API 。如果您使用供应商前缀,它似乎也可以在Firefox上运行。


I need an easy way to allow users to upload multiple files at once (ie I need to allow a user to upload a folder). I do not wish to put the burden of zipping on the user.

I would prefer to avoid Flash or variants if possible. I'm looking for a straight javascript / HTML solution if it is possible. Please note, this rules out the answers at: What is the best client side browser library to upload multiple files over http?.

解决方案

You won't be able to do it with just HTML and Javascript. I'd recommend trying Fancy Upload, a MooTools plugin for multiple file uploads. It uses a mixture of JavaScript and Flash, but degrades gracefully. It works with all major browsers including IE6 and there is also a Flash 10 compatible release available for download (though the demo hasn't been updated yet).


Update (2012-11-26):

Multiple file uploads are possible with valums or blueimp file uploaders.

For recursive directory uploads, your best solution is using Chrome 11's new folder upload API. It also seems to work on Firefox if you use a vendor prefix.

这篇关于将文件夹上传到网站的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆