您可以使用 JavaScript 但不使用 ActiveX 列出目录中的文件吗?

发布于 2024-09-13 11:32:36 字数 226 浏览 3 评论 0原文

我用 php 编写了一个脚本,它允许我以数组的形式获取目录中的文件列表,解析每个文件的特定字符串,然后显示包含搜索字符串的所有文件。

但我的 IT 人员不允许我在服务器上安装 php。可以使用 javascript 而不使用 ActiveX 来完成此操作吗?我能找到的所有东西都很旧了。

或者,有没有办法让像 opendir 和 readir 这样的 php 函数在远程服务器上工作?

谢谢

I wrote a script in php that allows me to get a list of files in a directory as an array, parse each one for a particular string, and then it displays all of the files that contain the search string.

My IT staff won't let me install php on the server though. Can this be done with javascript without ActiveX? Everything I could find on this is pretty old.

Alternatively, is there a way to make php functions like opendir and readir work on a remote server?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

满栀 2024-09-20 11:32:47

如果可以的话,这将是相当严重的安全违规。您需要在具有文件系统访问权限的服务器上安装某些东西。如果这是在内部网络上,您也许可以简单地启用目录浏览...但没有任何仅限客户端的解决方案。

This would be quite the security violation if you could. You will need to have something installed on the server that has file system access. If this is on an internal network, you may be able to simply enable directory browsing... but there aren't any client-side-only solutions to this.

吹梦到西洲 2024-09-20 11:32:44

如果目录位于远程服务器上,JavaScript / ActiveX 也不会帮助您完成所需的操作。所以不,不能这样做。

Nor JavaScript / ActiveX will help you do what you need to do if the directories are on a remote server. So no, can't be done.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文