+ 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!

19th Jul 2018, 9:40 PM
Erik Johanson
Erik Johanson - avatar
2 odpowiedzi
+ 3
You can not edit files with javascript. Only server side languages has access to your computer.
19th Jul 2018, 10:18 PM
Toni Isotalo
Toni Isotalo - avatar
+ 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.
28th Jul 2018, 1:31 AM
Jay Dadhania
Jay Dadhania - avatar