Questions tagged [html5-filesystem]

The File System API is an abandoned API intending to allow manipulating files and directories in a *virtualized* file system stored by the browser in a sandboxed area of the client system.

IMPORTANT: In April 2014, it was announced on public-webapps that the Filesystem API spec should be considered "clearly dead," as browsers have shown little interest in implementing it.


The File System API simulates a sandboxed virtualized file system that can be used to manipulate files and directories.

In spite of its name, the File System API cannot directly access the local file system. This is probably the most misunderstood aspect (and commonly asked question) about this API. For example, the API cannot be used to GetFile('C:\Users\Public\Desktop\foobar.txt') from the client file system. Likewise, the API cannot write directly to the client file system.

When writing data to the local system, web clients (browsers) do not locally store files according to their (virtual) file names as created in the script. Creating a file named "login.txt" in the API does not cause the client to store a real file called "login.txt" on the local file system. Google Chrome, for example, will only store a numerically named file (e.g., "00004") in a directory dedicated to sandboxed storage on the client device. Therefore the File System API cannot be used to write to the local file system in any way intended for external/outside access to the sandboxed storage area. In some environments, best practices for secure coding may prohibit the persistent storage of sensitive data through the File System API, as malicious code running locally on the host machine may gain access to the sandboxed storage area.

To prevent local storage of malicious code, the API prohibits storage of executable files (such as .exe files) in the virtualized file system.

See Also

312 questions
229
votes
8 answers

JavaScript blob filename without link

How do you set the name of a blob file in JavaScript when force downloading it through window.location? function newFile(data) { var json = JSON.stringify(data); var blob = new Blob([json], {type: "octet/stream"}); var url =…
Ash Blue
  • 4,249
  • 4
  • 25
  • 33
49
votes
6 answers

Where does PERSISTENT file system storage store with chrome?

When doing webkitRequestFileSystem in window.PERSISTENT option in Google Chrome, where on my filesystem do files get written? I'd like to drop files there and have Chrome interact with them while I'm building and debugging this app.
George Mauer
  • 103,465
  • 117
  • 349
  • 581
31
votes
5 answers

Browserify with require('fs')

I was trying to use browserify on a file that uses the fs object. When I browserify it, the call to require('fs') doesn't get transformed and require returns {}. Is there any workaround for this? I've seen some suggestions on stackoverlow and…
Fred Finkle
  • 1,697
  • 2
  • 17
  • 21
24
votes
3 answers

How to use navigator instead of window.webkitStorageInfo HTML5 File-system API?

So there is a similar post found here html-5-filesystem-access-type-error. However, I'm not very satisfied with the conclusion because I do not feel it actually answered the question - the solution given is the deprecated code solution. Does anyone…
Arthur Weborg
  • 7,288
  • 5
  • 26
  • 61
21
votes
2 answers

Pass large amounts of data between web worker and main thread

Is there a way to pass large amounts of data (multiple MB) between a web worker and the main thread? I work in a project where I need to download files, modify them a bit and then somehow let the user download the modified file. I found the…
Erik
  • 643
  • 2
  • 7
  • 10
19
votes
1 answer

Huge JavaScript HTML5 blob (from large ArrayBuffers) to build a giant file in client side

I'm writing a web browser app (client-side) that downloads a huge amount of chunks from many locations and joins them to build a blob. Then that blob is saved to local filesystem as a common file. The way I'm doing this is by mean of ArrayBuffer…
sgmonda
  • 2,264
  • 1
  • 17
  • 27
18
votes
1 answer

Show video blob after reading it through AJAX

While I was trying to create a workaround for Chrome unsupporting blobs in IndexedDB I discovered that I could read an image through AJAX as an arraybuffer, store it in IndexedDB, extract it, convert it to a blob and then show it in an element…
Pedro Almeida
  • 488
  • 1
  • 6
  • 10
14
votes
1 answer

html5 saveAs support in google chrome

I am trying to use saveAs interface as explained here For the moment, I only worry about Google Chrome, and I uses latest Canary (Version 27.0.1429.0 canary) Qn1: the article says. The W3C File API includes a FileSaver interface, which makes…
bsr
  • 52,180
  • 78
  • 198
  • 296
11
votes
1 answer

HTML5 and Amazon S3 Multi-Part uploads

Is it possible to use the HTML 5 File API (for example, this library: https://github.com/23/resumable.js ) in conjunction with the S3 multi-part upload feature? http://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html
sleepy_keita
  • 1,363
  • 3
  • 15
  • 25
10
votes
2 answers

Why does 'file.size' take a lot of time, and how to reduce the time?

I am making an app that deals with songs being dragged to the app. When I use the file.size to get the size of the file it takes approx 1500ms (avg) to get this value. Is there any faster way? I understand why it takes time (and memory) but since I…
Achshar
  • 4,773
  • 7
  • 36
  • 64
10
votes
2 answers

window.requestFileSystem not working

I am trying on Firefox,IE 9,Chrome and Opera the code below ,but the onInitFs(fs) function doesn't get called.if I add '()' to onInitFs in the window.requestFileSystem(window.PERSISTENT, 1024*1024, onInitFs, errorHandler) that function get called…
Tony2
  • 101
  • 1
  • 1
  • 4
9
votes
3 answers

Cordova: LocalFileSystem is not defined

I am not able to get the cordova file system to work. I have a project with the following dependencies: com.ionic.keyboard 1.0.3 "Keyboard" org.apache.cordova.console 0.2.12 "Console" org.apache.cordova.device 0.2.13 "Device" org.apache.cordova.file…
Bastian
  • 4,248
  • 5
  • 34
  • 53
9
votes
1 answer

Read File stored on some URL using HTML5 File API

I'm using HTML5 file API to upload files to my web application. I have an input element on my web page using which I read files and call upload function $('input[type="file"]').on("change",function(e){ …
sublime
  • 3,675
  • 9
  • 46
  • 83
9
votes
1 answer

Cordova - FileSystem - why so many path alternatives?

I am just looking through the Cordova source code to try and figure something out, and there are currently six alternate methods/properties to access the path of a file. Currently (running using iOS), there is: // Properties file.fullPath; //…
keldar
  • 5,548
  • 8
  • 46
  • 68
9
votes
1 answer

How Mega downloads a file?

when you download a file from MEGA service, a web page to display a download progress bar will appear. After the bar reaches 100%, your browser will notify users to save the file into a selected folder. I know that Mega use HTML5 FileSystem API to…
tuandhq
  • 99
  • 1
  • 1
  • 2
1
2 3
20 21