Application Cache works well when using it to save front-end resources such as images, fonts, CSS files, JS files, etc....
I'm trying to use it to save other files, such as PDF and XLS files...
And that is where things get complicated...
I can retrieve PDF files from the App Cache with no problems, but the retrieval of XLS/XLSX files behaves in weird manners across browsers:
Firefox 36 OSX: XLS/XLSX files can be retrieved
Chrome 40 OSX: XLS/XLSX files can be retrieved
Chrome 39 iOS: An error page with code 100 is displayed
Safari 8 OSX & Safari 8.1.3 iOS: XLS/XLSX data is shown as ugly plain ASCII
Safari 7.1.2 iOS: A popup alert is displayed saying "Safari cannot open the page because the address is invalid"
Tests are done with Python's SimpleHTTPServer module, and every resource are valid and can be retrieved from NETWORK successfully.
It seems like RTF, DOC/DOCX and ZIP files behaves like XLS/XLSX files.
I don't understand why the binary data in a PDF file can be downloaded successfully but the others listed above can't...
Any help is welcome!
s.
Related
I am trying to figure out where and how does Chrome save local storage.
I found the following folder (in my home folder) that seems to contain the local storage:
\AppData\Local\Google\Chrome\User Data\Default\Local Storage
In this folder I see files that corresponds to different URLs (the files contain URLs in their names). For each URL I see two types of files:
LOCALSTORAGE file
LOCALSTORAGE-JOURNAL file
I am interested in local storage of one particular web site. For this web-site the LOCALSTORAGE file contains only 6KB and the LOCALSTORAGE-JOURNAL contains nothing (0 KB).
On the other hand, when I open the web site of interest in Chrome and then press F12 I see in the local storage 6 different URL and if I click on one of them I see key-value pairs.
So, what I see in the folder and in the Chrome development tool is not consistent. Why is that? How can one find content of local storage in the directories? Or is it impossible?
The file is in SQL Lite format. Install SQL Lite, then type the following commands:
cd %LocalAppData%\Google\Chrome\User Data\Default\Local Storage
sqlite3 *filename*
select * from ItemTable;
.quit
The ItemTable table contains key-value pairs, the semantics of which depend on the individual website.
see the description of localstorage file here
it says : The extension LOCALSTORAGE indicates an application support file created by the web browsers using WebKit, such as Google Chrome and Apple Safari. These files store browser settings or local data for a browser extension, and enables extensions to store a local cache of user data saved in an SQLite database format.
You can browse localstorage files by a sql-lite browser, such as the open source program called sql-lite database browser
I'm able to use HTML5 standard File API and IndexedDB to store large binary files in the browser.
However, when offline, I need to be able to open these files. Using data URLs works great for small files, but none of the browsers support 10Mb file opening through data URL. Is there any other solution, except for non-standard window.webkitRequestFileSystem?
I've actually found an answer here: https://developer.mozilla.org/en/docs/Web/API/Blob.
It is possible to save result of FileReader.readAsArrayBuffer in IndexedDB. When offline, it is possible to create a blob from this typed array and then create data URL to be passed to window.open function. Works with large files!
In my application I import a variety of images into my database, but before storing them I convert them all to PNG using ImageMagick's convert script.
Every once in a while I encounter PDFs that can not be converted properly although they render fine in Chrome. Some of these PDFs render fine in Firefox, but mostly all of them render fine in Chrome.
The error I get when converting them using ImageMagick is:
Last OS error: 2
GPL Ghostscript 8.70: Unrecoverable error, exit code 1
convert: Postscript delegate failed `email.pdf': No such file or directory # pdf.c/ReadPDFImage/611.
convert: missing an image filename `/tmp/reza%d.png' # convert.c/ConvertImageCommand/2800.
What are my alternatives to this problem?
Thanks a bunch
I have a Windows Store app in which I use Media Foundation to create mp4 files. I use the function MFCreateSinkWriterFromURL to create the file and the function IMFSinkWriter.WriteSample to write audio and video data to the file. This all works fine on my DELL laptop, my Surface tablet. So these mp4 files play well on all machines. When the app runs on an ASUS ME400C tablet, it creates an mp4 file, but the file can not be played back on that machine or on any other machine. So the app is on all machines the same (downloaded from the store), but the encoding is different.
If I open the file in TopoEdit tool, I get the following error: Failed to create source node. The byte stream type of the given URL is unsupported.
How to find out what the problem is with the mp4 file created by the Asus machine? Are there tools that can help me analyzing that file?
Just in case someone is interested. I have here a mp4 created with an Asus machine
https://skydrive.live.com/redir?resid=9A6F31F60861DD2C!449&authkey=!AJVXFclI4BoJs0o
and a mp4 created with my Dell laptop here
https://skydrive.live.com/redir?resid=9A6F31F60861DD2C!450&authkey=!AKtrfkDprZyJJI0
Regards
Ronald
Use MediaInfo or QuickTime to check the format of the file
Asus.mp4 file is corrupted one. This is file is not opening in VLC, Media Player and Quick Time.If you right click the file and check the Properties->Details you will find Video and Audio section empty.While creating the file some where your code is failing or file properties is not properly set. It is able to create the file but certain properties is missing.Use MFTrace to find that.
In using the HTML5 WebStorage functionality, I know that certain browsers, like Chrome, have developer tools that enable users to browse thru the contents of their WebStorage for debugging and trouble-shooting purposes.
I was wondering if it is possible to view the contents of web storage in the file system. Is this content stored in text files on the file system that are in some standard location? Or is this data stored in some proprietary binary format by the various browsers and is not designed to be accessible or viewable by browsing the file system?
My motivation for asking this question is to see if you can view the content of WebStorage on the file system as an aid to development and debugging, and also just out of curiosity too see how this data is actually stored.
Thanks.
Chrome uses SQLite for LocalStorage.
I confirmed this by going to AppData\Local\Google\Chrome\User Data\Default\Local Storage on my local PC and viewing the contents of a file. The files start with "SQLite format 3" when viewed via a text editor. You will need a SQLite database viewer to view the data.
On Mac OS X, this was at ~/Library/Application Support/Google/Chrome/Default/Local Storage
I used the Command Line Shell For SQLite to look around. Assuming www.example.com was a real site, you can run these commands:
$ sqlite3 http_www.example.com_0.localstorage
sqlite> .tables
ItemTable
sqlite> .schema
CREATE TABLE ItemTable (key TEXT UNIQUE ON CONFLICT REPLACE, value BLOB NOT NULL ON CONFLICT FAIL);
sqlite> select * from ItemTable;
stringkey|value
jsonkey|{"key","value"}
sqlite> .exit
See Where does firefox store javascript/HTML localStorage? for the Firefox storage location. Chrome uses individual sqlite files per hostname and protocol, where Firefox uses a single webappsstore.sqlite file with the reversed hostname and protocol in a scope column.
See Where the sessionStorage and localStorage stored? for the Opera storage location. Opera uses an XML index file and individual XML files for the Base64 encoded data.
Just wanted to contribute for IE 11.
The localstorage is stored in: C:\Users[YOUR USER ACCOUNT]\AppData\LocalLow\Microsoft\Internet Explorer\DOMStore
However, it is hidden by default. To show this folder you have to:
Folder Options --> Uncheck "Hide protected operating system file"
Back to folder, you will see some sub folder inside. Go to each folder will see some XML files according for websites.