Advertisement
achshar

Untitled

May 18th, 2011
491
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function requestFileSystemSuccess(fs) {
  2.  fs.root.getFile('log.txt', {create: true}, function(fileEntry) {
  3.  
  4.     fileEntry.createWriter(function(fileWriter) {
  5.  
  6.       fileWriter.onwrite = function(e) {
  7.         console.log('Write completed.');
  8.       };
  9.  
  10.       fileWriter.onerror = function(e) {
  11.         console.log('Write failed: ' + e.toString());
  12.       };
  13.  
  14.       var bb = new window.WebKitBlobBuilder();
  15.       bb.append('Lorem Ipsum');
  16.       fileWriter.write(bb.getBlob('text/plain'));
  17.  
  18.     }, error);
  19.  
  20.   }, error);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement