Javascript previews with new FileReader API and DataURLs seem inefficient-Collection of common programming errors

You can also store data on the client’s disk (in another location so that you can access the file using JavaScript). This article is quite extensive when it comes to this subject:

http://www.html5rocks.com/en/tutorials/file/filesystem/

It’s not supported on all browsers though.

You have to request storage space (the file system), then create a file, write data to it, and finally fetch the URL:

window.requestFileSystem(window.PERSISTENT, 5*1024*1024, function(fs) {
    fs.root.getFile(filename, {create: true}, function(fileEntry) {
        fileEntry.createWriter(function(fileWriter) {
            var arr = new Uint8Array(data.length);

            // fill arr with image byte data here

            var builder = new BlobBuilder();
            builder.append(arr.buffer);
            var blob = builder.getBlob();

            fileWriter.write(blob);

            location.href = fileEntry.toURL(); // navigate to file. The URL does not contain the data but only the path and filename.
        });
    });
}, function() {});