Skip to content Skip to sidebar Skip to footer

Saving A File From A Chrome Packaged App

I have a Chrome packaged app that has taken me a while to get my head around but I finally have it working. However I have now come across another problem. Is it possible to save a

Solution 1:

I would suggest storing the file's contents in chrome.storage and then dynamically loading and saving the contents of your css file from there instead of using the filesystem. To me, this would be much easier to accomplish.

Solution 2:

chrome.storage sounds like a good fit all right (though not too sure about your specific needs in accessing the css outside the app). It's main use case is for saving state and storing configuration settings/variables.

We've a code lab that walks through all kinds of chrome apps stuff, including chrome.storage here: http://developer.chrome.com/trunk/apps/app_codelab5_data.html

There's also the new syncFileSystem API, which really doesn't seem to fit your needs. This is document/file level synchronization, like getting access to user's files on hard drive, saving them in app, and syncing them.

But sure, if you are curious, here's the docs on working with Chrome File System and sync File System: http://developer.chrome.com/trunk/apps/app_storage.html

We're also working on a doc that explains the key concepts around storing data in the cloud (specifically for packaged apps). Hoping to have an early cut in trunk over the next week or so.

Keep us posted on how you get on!

Post a Comment for "Saving A File From A Chrome Packaged App"