简体   繁体   中英

Read from file in Javascript

Hello I am developing a Google Chrome extension and need to read some information from a .txt file, so I did some research but i just found how to choose a file and read from it, but what I need to do is just read from a path, like c:\\file.txt, not choose it and after read. I would really appreciate if any one could help me, thanks.

You should be able to use the runtime API to read local files if they are inside the app package directory using getPackageDirectoryEntry.

If you are trying to read random files then it's not possible without the user selecting it, js is sandboxed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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