简体   繁体   English

如何使用 javascript 读取文件?

[英]How could I read file with javascript?

I'm using chrome now and I decide to convey a test about how to use javascript reading local file.我现在正在使用 chrome,我决定传达一个关于如何使用 javascript 读取本地文件的测试。 Someone says it's easy but he uses IE, maybe on the chrome side things got a little diffrent, can someone show me how to do it?有人说这很容易,但他使用 IE,也许在 chrome 方面有些不同,有人可以告诉我怎么做吗?

Security considerations dictate that you don't have any access to the local filesystem through Javascript.出于安全考虑,您无法通过 Javascript 访问本地文件系统。 You'd have to have your user upload the file to the server first.您必须先让您的用户将文件上传到服务器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM