如何使用JavaScript列出文件夹中的本地文件?

发布于 2025-02-06 09:02:16 字数 240 浏览 2 评论 0原文

在过去的两天中,我是使用JavaScript的初学者,我正在寻找使用JavaScript访问文件列表的解决方案,但找不到任何解决方案。

我正在尝试构建一个可以在客户端计算机上显示文本文件列表的网络应用程序,然后单击它打开。如果还有其他方法可以使用另一种技术实现此目标,请告知我哪一个是最好的。

我现在使用的操作系统是Windows,如果我能在所有方面具有相同的功能其他操作系统。

提前致谢

I am a beginner using JavaScript in the past two days I am searching for a solution to access the list of files using Javascript but I could not find any solution.

I am trying to build a web app that can show the list of the text files on the client's computer and then click it to open. If there is any other way to achieve this goal using another technology, please advise me which one would be the best.

The operating system now I am using is windows it would be good if I could have the same functionality on all other operating systems.

Thanks in advance

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

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

发布评论

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

评论(1

你怎么敢 2025-02-13 09:02:16

正如@sirko和@bravo评论的那样,不可能用浏览器访问本地驱动器上的文件,这全是由于安全原因。访问浏览器文件的唯一方法是使用Input标记“ file”属性。

As it is commented by @sirko and @Bravo it is not possible to give access to the files on the local drive with the browsers it is all because of security reasons. The only way to access files on the browser is to use the input tag with "file" attribute.

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