如何启用Google chrome的本地文件系统读写权限? [英] How to enable local file system read write access from Google chrome?

查看:2126
本文介绍了如何启用Google chrome的本地文件系统读写权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用HTML / Javascript代码启用Google-Chrome的本地文件系统读/写访问。
我使用的是存储在本地系统中的一组html页面(例如file:// c:/project1/page.html ...)。

我目前的观察是,我们可以使用FileReader JavaScript类进行本地文件读取操作,而无需在浏览器中进行任何额外的配置或设置。但是,当我试图使用一些JS代码写入本地文件时,它通过向用户显示每个写入操作的提示框来请求许可。



所以我的问题是,是否有任何方法可以禁用这种来自google-chrome的文件写入操作提示?
我已经看到chrome将浏览器配置存储在位于chrome安装文件夹内的 master_preferences 文件和首选项文件中,但无法找到相同类型的条目/记录。



谢谢&

rel =nofollow> JQuery.twFile 为此目的。阅读本地文件系统并写入文件非常棒。



在读取或写入文件时,不会显示任何错误或提示。



尽管在Chrome中可能会显示其他类型的提示。 (Java相关提示)



使用它时,为了防止Java相关提示,我以这种方式启动Chrome:



C:\ Users \WHATEVER\AppData\Local\Google\Chrome\Application\chrome.exe --allow-outdated-plugins --allow-file-access-from-files



另外,请务必执行以下操作:

转至网址:chrome:// plugins /
然后,在Java下,确保选中始终允许复选框

I need to enable local file system read/write access from Google-Chrome using HTML/Javascript code. I am using set of html pages which are stored in local system (ie file://c:/project1/page.html ...).

My current observation is that we can do local file reading operation using FileReader javascript class without making any extra configuration or settings in the browser. But when I tried to write in the local file using some JS code it keeps asking for permission by showing Alert box to the User for every write operation.

So my question is, Is there any way to disable this kind of prompting for file write operation from google-chrome? I've seen that chrome stores browser configuration in master_preferences file and Preferences files located inside chrome installation folder, But couldn't find such kind of entry/record for the same.

Thanks & Regards.

解决方案

I like to use JQuery.twFile for this purpose. It's great for both reading from local flesystem AND writing to it.

It will not show you any errors or prompts when reading or writing a file.

It may show some other kind of prompts though in Chrome. (Java related prompts)

While using it, in order to prevent Java related prompts I launch Chrome in this manner:

C:\Users\WHATEVER\AppData\Local\Google\Chrome\Application\chrome.exe --allow-outdated-plugins --allow-file-access-from-files

ALSO, be sure to do the following:

Go to URL: chrome://plugins/ Then, under Java, be sure checkbox for "Always Allowed" is checked

这篇关于如何启用Google chrome的本地文件系统读写权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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