如何在Chrome中允许文件访问文件? [英] How to allow-file-access-from-files in Chrome?

查看:1837
本文介绍了如何在Chrome中允许文件访问文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Chrome来测试一些WebGL纹理程序。根据本书'WebGL编程指南',如果我需要从本地磁盘访问文件,我应该添加选项 - 允许文件从文件访问到Chrome。



我该怎么做?

解决方案

简短的答案是 不要

<打开一个shell /终端/命令行并输入

  cd path / to / htmlfiles 
python -m SimpleHTTPServer

然后在浏览器中去

 http:// localhost:8000 

如果您发现它太慢考虑这个解决方案



您不想允许文件访问的原因是允许它可以用来从您的机器上窃取数据。例如,你去一个网站并下载一些网页。然后您可以在本地查看该页面。通过本地运行页面上的文件访问,现在可以访问所有文件并将其上传到服务器。


I am using Chrome to test some of my WebGL texture programs. According to the book 'WebGL Programming Guide', if I need to access files from my local disk, I should add the option --allow-file-access-from-files to Chrome.

How do I do that?

解决方案

The short answer is DON'T

Open up a shell/terminal/command line and type

cd path/to/htmlfiles
python -m SimpleHTTPServer

Then in your browser to go

http://localhost:8000

If you find it's too slow consider this solution

The reason you don't want to allow file access is allowing it can be used to steal data from your machine. For example, you go to a site and download some webpage. You then view that page locally. With file access on that locally run page can now access all your files AND upload them to a server.

这篇关于如何在Chrome中允许文件访问文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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