html5-filesystem

Checking for HTML5 File API Support in Angular?

落花浮王杯 提交于 2019-12-13 22:46:23
问题 When coding a check for HTML5 File API browser support like this: private hasHtml5FileApiSupport; constructor(@Optional() @Inject(DOCUMENT) document: Document) { const w = document.defaultView; this.hasHtml5FileApiSupport = w.File && w.FileReader && w.FileList && w.Blob; VSCode draws red squigglies under the w.File && w.FileReader && w.FileList parts. Is there a way to get rid of these / Is there a better way to do this? 回答1: If we inject document using the Document type then we get the

I can't open local files from Filesystem API on my Android phone

偶尔善良 提交于 2019-12-13 20:43:18
问题 I have made an HTML 5 application that downloads a pdf file on my server, and writes it in the browser sandbox system. When I go to filesystem:myServerUrl/persistent, I see my pdf file with the correct size. I click on it, and there is a "download started" notification, but about one second later, I get a download error (Reason 404 when I look into the Android logs). I tried with a Download. But I have the same error. Note that it is working fine on my computer, and when I try with an image,

HTML5 File API in Firefox Addon SDK

吃可爱长大的小学妹 提交于 2019-12-13 14:21:02
问题 Is there a way to access Html5 file api in Fire Fox addon sdk in the content script? This is needed in order to store user added words and their meanings. The data can grow large and so local storage isn't an option. window.requestFileSystem3 = window.requestFileSystem || window.webkitRequestFileSystem; gives me the error TypeError: window.requestFileSystem3 is not a function . I am asking this because i am porting this code from a Google Chrome Extension which allows accessing the file api

EncodingError when cordova-plugin-file

∥☆過路亽.° 提交于 2019-12-13 11:35:14
问题 I am now developing a cordova app which platform is browser. I need to access a text file from local file system, so I am using the cordova-plugin-file. But I failed as the exception in my chrome console like this (There is no CLI error): code: 5 message: "A URI supplied to the API was malformed, or the resulting Data URL has exceeded the URL length limitations for Data URLs." name: "EncodingError" as my code blow: document.addEventListener('deviceready', dataRead, false); function dataRead()

Android: requestFileSystem in WebView causing crash

给你一囗甜甜゛ 提交于 2019-12-13 02:26:24
问题 I'm developing an offline app where I have to save files in html5 fs-sandbox. At desktop in Chrome everything works fine. But my android device is crashing with 10-12 10:49:53.953: A/libc(9231): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1) until I'm calling window.requestFileSystem(window.PERSISTENT, 5*1024*1024, fsInit, errorHandler); Because window.storageInfo is not defined in my WebView I could not call requestQuota in first. But window.requestFileSystem is defined and I think the

Chrome App Persistent Filesystem Storage not reliable

徘徊边缘 提交于 2019-12-11 18:04:42
问题 I am having issues with my google chrome app and filestorage. The app is run online and gathers files to store offline so that it should be able to function properly offline later. It does this for the most part but sometimes but rarely after a computer restart or restarting the browser it seems to be missing the files in filesystem... I guess my question is, how do i ensure that Persistent storage remains persistent? Edit: Code Request filesystem window.requestFileSystem = window

Reading local files/directories with html5 filesystem api

那年仲夏 提交于 2019-12-11 13:41:39
问题 I was wondering if it's possible to read the content of a local directory, for instance C:\temp, using the html5 filesystem api or is it only possible access files/directories in the "sandboxed area"? 回答1: The HTML5 file system is designed solely for sandboxed file storage, so no, you cannot use it to access files on the user's non-sandboxed file system. 回答2: There is the drag and drop method example at MDN which works to display the file or folder name. If it's a directory, it lists the

Is it possible to easy get normal (deobfuscated) access to all files in a sandbox written using FileSystem API?

末鹿安然 提交于 2019-12-11 07:59:50
问题 I used Filesystems API to write to a new file in a sandboxed storage of Chrome: preparing the FS: window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem; function errorHandler(e) { var msg = ''; switch (e.code) { case FileError.QUOTA_EXCEEDED_ERR: msg = 'QUOTA_EXCEEDED_ERR'; break; case FileError.NOT_FOUND_ERR: msg = 'NOT_FOUND_ERR'; break; case FileError.SECURITY_ERR: msg = 'SECURITY_ERR'; break; case FileError.INVALID_MODIFICATION_ERR: msg = 'INVALID

Where is the file sandbox for a Chrome app?

安稳与你 提交于 2019-12-11 04:28:31
问题 I'm developing a chrome app with the capability to handle files. I need to copy these files to the app, which I believe stores it in the app's sandbox. But where are these files, like on my disk? Here's where I get access to the filesystem: fs = null oneGig = Math.pow 2, 30 # 1GB window.webkitRequestFileSystem window.PERSISTENT, oneGig, (_fs) -> # on fs init fs = _fs console.log fs.root.fullPath #=> "/" obviously not right (e) -> # on fs error console.log e Followed by this code to actually

HTML5 fileWriter.write doesn't write to local file

和自甴很熟 提交于 2019-12-11 01:27:43
问题 I am working on the tutorial for HTML5 FileSystem-API. Basically I would like to write a file to my machine. I am using python's simpleHTTPServer to serve the website. Once I load the webpage, the console doesn't raise an error and I get a message that the write was successful. But I can't find the file anywhere on my machine. Here is my code: function onInitFs(fs) { fs.root.getFile('zz11zzlog.txt', {create: true}, function(fileEntry) { // Create a FileWriter object for our FileEntry (log.txt