通过任何方式检索目录位置
我需要检索文件或目录的位置。它基本上是这样的:
/< input type="file"/>
但我只需要返回文件或目录的位置。
目前,我对文件用例没有问题,但我找不到目录用例的解决方案。我在网上查了一下,看到有人说仅用 html 无法完成,我需要使用 PHP 或 Flash。 Flash 不完全是一种选择,所以有人对使用 PHP 执行此操作有任何提示或一般建议吗?
谢谢,
布拉德
I need to retrieve the location of a file or directory. It would basically be like:
/< input type="file"/>
but I would only need to return me the location of the file or directory.
I don't have an issue with the file use case currently, but I cannot find a solution for the directory use case. I've looked around online and seen people saying it cannot be done with just html and I would need to use PHP or Flash. Flash isn't exactly an option, so does anyone have any tips on doing this with PHP or just any suggestions in general?
Thanks,
Brad
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于浏览器来说,默认情况下不允许这样做,这存在太大的安全风险。您需要能够在客户端计算机上运行代码来检索目录,因此 Flash 或 ActiveX 等客户端解决方案是您唯一的选择。
This is too much of a security risk for a browser to allow by default. You will need to be able to run code on the client machine to retrieve the directory, so client-side solutions like Flash or ActiveX are your only options.