Is there any way to save a content like a string or an image to a file(like "C:\temp") in Chrome extension?
Does chrome or js provide any API to handle file system?
Asked
Active
Viewed 5,196 times
2

Leslie Wu
- 760
- 3
- 13
- 29
-
Do explicitly need to interact with the OS file system or do you just need a place to store your data like local storage? – Quintin Robinson Mar 26 '13 at 02:47
-
I wanna interact with the OS file system, not chrome local storage. – Leslie Wu Mar 26 '13 at 04:27
2 Answers
2
There is a way to trigger a system file save dialogue via JS.
function exportToFile() {
var myString = "Lorem ipsum.";
window.open('data:text/csv;charset=utf-8,' + escape(myString));
}
exportToFile();
Another way is to use the new FILE API.

Tom
- 556
- 1
- 7
- 16
-
BTW, if you want to download a lot of existing files, you might want to just generate a set of URLs and use a download manager to save them. – Tom May 19 '14 at 11:37
-
0
No, there is no way for a chrome extension to manage the filesystem aside from using a custom NPAPI plugin con can get more info about using NPAPI plugin at http://developer.chrome.com/extensions/npapi.html

frisco
- 1,897
- 2
- 21
- 29