+ 2
How can I use JavaScript to edit local files on Chromebooks?
I'm developing a code editor for my Chromebook and would like to know how to make it possible to edit local files. Thanks so much for your help!
2 Antworten
+ 3
You can not edit files with javascript. Only server side languages has access to your computer.
+ 1
My friend Toni Isotalo is correct, you cannot access local files with javascript. It is for the security stuff.
Assume javascript can access local files, now you accidentally visit a malicious website, and boom! All your files are gone!
You need to setup a local server on your device, for example apache, with a server side language like PHP which can access the files on the device. Then you can use javascript to interact with PHP which ultimately can edit/modify local files.