Return to Snippet

Revision: 52894
at November 4, 2011 07:24 by parkerkrhoyt


Initial Code
window.requestFileSystem(
  LocalFileSystem.PERSISTENT, 
  0, 
  function doAccess( fs ) {
    // alert( 'Got file access' );
    
    fs.root.getFile( 
      SOURCE,
      {
        create: true,
        exclusive: false  
      },
      function( fe ) {
        reference = fe.fullPath;
        fe.createWriter( 
          function( writer ) {
            // alert( 'Ready to write' );
            
            writer.onwriteend = function( e ) {
              // alert( 'File written' );
            };
            
            writer.write( ' ' );
          }
        );
      }, 
      function( err ) {
        // alert( 'No access to file entry' );
      }
    );
  }, 
  function( err ) {
    // alert( 'File system not responding' );  
  }
);

Initial URL

                                

Initial Description

                                

Initial Title
Use PhoneGap to Create a File

Initial Tags
phone, file, mobile, api

Initial Language
JavaScript