如何让用户从 HTML 页面中选择一个文件夹,以便可以上传所有文件 [英] How can I let the user select a folder from an HTML page so that all the files can be uploaded

查看:106
本文介绍了如何让用户从 HTML 页面中选择一个文件夹,以便可以上传所有文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 <input type="file"/> 标签允许用户上传单个文件非常容易.

Allowing a user to upload a single file is very easy using the <input type="file"/> tag.

如何让用户选择整个文件夹以便可以上传其内容.我想使用 Java 小程序会起作用,但我希望有一个更简单的解决方案.

How can I let a user select an entire folder so that it's contents can be uploaded. I imagine that using a Java applet would work, but I am hoping there is a simpler solution.

推荐答案

浏览器中没有这样的支持 - 主要是出于安全原因.如果您让用户选择一个文件夹并且浏览器可以扫描所有文件,则您可能会扫描他们的整个硬盘驱动器.

There is no such support in browser - mostly for security reasons. If you let a user select a folder and the browser could scan through all files, you could potentially scan through their whole hard drive.

这篇关于如何让用户从 HTML 页面中选择一个文件夹,以便可以上传所有文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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