且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

用javascript打开本地文件系统中的文件

更新时间:2022-12-16 17:11:18

抱歉,Abi,您走运了——您无法在浏览器中使用 JavaScript 打开本地文件系统上的文件.这是一个安全问题,如果您仔细考虑一下,这是完全有道理的;您不希望人们在他们的网站上编写可以访问本地文件系统上的文件并可能从中读取数据的脚本!

Sorry, Abi, you're out of luck--you can't use JavaScript in a browser to open a file on the local file system. This is a security issue and makes perfect sense if you think about it; you wouldn't want people writing scripts on their web sites that can access files on your local file system and possibly read data from them!