【发布时间】:2011-12-23 20:53:40
【问题描述】:
如果我在 html 文件中插入 <input type="file" name="files" webkitdirectory>,chrome 将允许您选择目录,但不能选择文件。
如果我随后删除 webkit 目录 (<input type="file" name="files">),那么它只会让您选择文件。
如何允许它同时选择文件和/或目录?
【问题讨论】:
-
我不熟悉 webkitdirectory,但据我所知,至少在 Windows 中没有一个用于选择目录和/或文件的本机对话框。所以我建议你在你的 UI 中实现这两个标签,然后让用户选择一个目录或一个文件或两者兼而有之。
标签: html google-chrome webkit directory-upload