Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 FileSystem API

I have created file 'log.txt' by fileSystem API

function initFS(grantedBytes) {
    window.requestFileSystem(window.PERSISTENT, grantedBytes, function (filesystem) {
        fs = filesystem;

        fs.root.getFile('log.txt', { create: true, exclusive: true }, function (fileEntry) {

            // fileEntry.isFile === true
            // fileEntry.name == 'log.txt'
            // fileEntry.fullPath == '/log.txt'
            console.log(fileEntry.fullPath);



        }, errorHandler);
    }, errorHandler);
}

initFS(1024*1024);

And do not fully understand its structure. Is There any way to explore this file for example from Windows Explorer and see it in file system?

like image 522
Taron Mehrabyan Avatar asked Oct 06 '13 09:10

Taron Mehrabyan


2 Answers

There is an even simpler way. On chrome, visit these urls.
For http, it's "filesystem:http://"+location.host+"/persistent/".
For https, it's "filesystem:https://"+location.host+"/persistent/".

like image 109
Darrennchan8 Avatar answered Oct 18 '22 05:10

Darrennchan8


Sort of, the File-system API doesn't encrypt the data being stored locally. It does however change the file naming conventions up. So you may have named it log.txt but if you poke around where the file-system API stores files, you'd probably find it under some arbitrary randomly generated file name like "00010" or in a random directory like "24/00123".

Anyway, you can open each file up in a text editor - if your file had text written to it you would be able to view it as such. Or if you wrote JSON to the file-system API it would be in human-readable string format when you opened in the text editor.

On Windows 7, with Chrome it's found here:

C:\Users\{user}\AppData\Local\Google\Chrome\User Data\Default\File System\

If you want to find out where it is stored via Chrome on other OS please see this post

like image 43
Arthur Weborg Avatar answered Oct 18 '22 05:10

Arthur Weborg