Reputation: 11468
Please, does anyone know what are the possibilities for accessing local filesystem from a browser? The use case I'm looking for is whether it is even possible to create a really simple text editor which could save text files locally? If so, what technologies does it take to implement such thing?
I know, historically, that it was certainly not possible to this. But now that we have Ajax and co. it is sometimes possible to open local files. There is even some form of local database (ok, not a file), maybe the extensions for a certain browser are allowed to write a file into a certain (predefined) location and then there is the local web server which could as a kind of proxy. And I even saw [1], though I'm not sure how well is it supported. What else?
In other words, suppose you open Notepad, type same text. Now you click "Save", it asks for the path and saves it [2]. Next time you save the file it remembers the path and saves the new content immediately. Is this possible with browser?
[1] http://dev.w3.org/2009/dap/file-system/pub/FileSystem/
[2] see e.g. http://www.nihilogic.dk/labs/canvas2image/ ("Save PNG")
Upvotes: 1
Views: 7593
Reputation: 3217
Back in 2020, you are probably after Electron JS, which offers an independant-OS platform to develop desktop programs with the use of JS, Html and CSS. It uses Chromium and NodeJs. Known apps are the GithubDesktop (Github is one of the founders of ElectronJS), WhatsApp and VSCode.
Upvotes: 0
Reputation: 2126
The are some new html5 javascript methods, called file api and filereader api. I only have experiences with the file api. Tried it some time ago and found it not consistent between FF and Chrome yet.
You can find further information on MDN:
https://developer.mozilla.org/en/DOM/FileReader
https://developer.mozilla.org/en/Using_files_from_web_applications
Upvotes: 1