Retrieving local file contents without downloading

I am writing a standalone webapp that allows the user to select a local file, modify it and save it locally. Is this possible without any server (I can upload the file and return base64, but this is not so much offline)? The app should only run on Google Chrome, so maybe I should look here?

+5
source share
3 answers
+3
source
 input = document.getElementById(inputId);          

 var reader = new FileReader();

 reader.onload = function (e) {
     base64 = e.target.result;
 };

 reader.readAsDataURL(input.files[0]);

input - <input type='file'></input>. , .

+2

To work with files in a browser, I use downloadify . To make it work with paths containing "file: //", you need to allow access to the downloadid.swf file system on settings .

-1
source

All Articles