【问题标题】:Use PHP to list file names in a folder selected by the user使用 PHP 列出用户选择的文件夹中的文件名
【发布时间】:2014-01-21 11:39:38
【问题描述】:

我已经尝试过 HTML5 webkitdirectory 的方法来上传指定目录中的所有文件。

<input type="file" name="files[]" id="files" multiple="" directory="" webkitdirectory="" />

但是,我只想要用户选择的目录中的文件名列表,而不是让浏览器将所有文件上传到服务器。

基本上,我想在客户端应用 scandir() 函数。还有其他方法可以实现吗?

【问题讨论】:

  • 我认为这不可能。可以使用 ActiveX 对象,但我不推荐。

标签: php file directory scandir


【解决方案1】:

据我所知,您无法在客户端应用 scandir(),因为 PHP 是在服务器端执行的

【讨论】:

    猜你喜欢
    • 2014-02-24
    • 1970-01-01
    • 1970-01-01
    • 2011-10-30
    • 2015-10-11
    • 1970-01-01
    • 2021-07-23
    • 1970-01-01
    • 2012-06-06
    相关资源
    最近更新 更多