Languages

Menu
Sites
Language
Blob object to file

Hi

Is it possible to save the blob object to a file?

Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

2 Replies
Lakshmi Grandhi
yes, please try below code function onInitFs(fs) { fs.root.getFile('log.txt', {create: true}, function(fileEntry) { // Create a FileWriter object for our FileEntry (log.txt). fileEntry.createWriter(function(fileWriter) { fileWriter.onwriteend = function(e) { console.log('Write completed.'); }; fileWriter.onerror = function(e) { console.log('Write failed: ' + e.toString()); }; // Create a new Blob and write it to log.txt. var blob = new Blob(['Lorem Ipsum'], {type: 'text/plain'}); fileWriter.write(blob); }, errorHandler); }, errorHandler); } window.webkitRequestFileSystem(window.TEMPORARY, 1024*1024, onInitFs, errorHandler);
Pavel Ivanov
Thank you for your help.