如何使用JavaScript获取本地文件夹内容 [英] How to get local folder contents using JavaScript

查看:1327
本文介绍了如何使用JavaScript获取本地文件夹内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用JavaScript获取本地文件夹内容。我已经试过了Filesystem API,但是我得到了这样的错误:



DOMException:确定某些文件在Web应用程序中不安全,正在对文件资源进行太多调用



如何在本地文件夹中获取图像并将这些图像显示为HTML?文件夹中的文件夹结构和图像动态变化。



编辑:我在这里试过文件系统: https://github.com/maciel310/angular-filesystem p> FileSystem API目前仅支持Chrome和Opera
http://caniuse.com/ #feat = filesystem

您还需要从用户那里获得访问持久数据的权限。



更多信息请参考这篇文章:
https:/ /www.html5rocks.com/en/tutorials/file/filesystem/#Reading 目录内容


I am trying to get local folder contents using JavaScript. I have tried the Filesystem API, but I got error like this:

DOMException: It was determined that certain files are unsafe for access within a Web application, or that too many calls are being made on file resources

How can I get images in a local folder and show these images as HTML? Folder structure and images inside a folder are changing dynamically.

Edit: I tried the filesystem here: https://github.com/maciel310/angular-filesystem

解决方案

FileSystem API is currently being supported only on Chrome and Opera http://caniuse.com/#feat=filesystem

Also you need to obtain permissions from the user to access peristent data.

For more info refer to this article : https://www.html5rocks.com/en/tutorials/file/filesystem/#Reading a directory's contents

这篇关于如何使用JavaScript获取本地文件夹内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆