function download() {
  // Create an instance of AWFileTransfer
  var fileTransfer = new Appworks.AWFileTransfer(
    function(file) {
      // Success callback
      out(file);
    }, function(error){
      // error callback
      out(error);
    }
  );

  // Add a progress handler
  fileTransfer.progressHandler(
    function (progress) {
      console.log(progress);
    });

  // Call the AWFileTransfer.download function
  // Pass in the base URL, the filename, options
  fileTransfer.download('http://thecatapi.com/api/images/get', 'file.jpg', null, shared);
}
/**********************************************************
* Function to download a hardcoded file for demo purposes *
**********************************************************/
Function to download a hardcoded file for demo purposes
Function to download a hardcoded file for demo purposes
function download() {
  var fileTransfer = new Appworks.AWFileTransfer(
    function(file) {
      out(file);
    }, function(error){
      out(error);
    }
  );
  fileTransfer.progressHandler(
    function (progress) {
      console.log(progress);
    });
  fileTransfer.download('http://thecatapi.com/api/images/get', 'file.jpg', null, shared);
}
function download ( ) { var fileTransfer = new Appworks . AWFileTransfer ( function ( file ) { out ( file ) ; } , function ( error ) { out ( error ) ; } ) ; fileTransfer . progressHandler ( function ( progress ) { console . log ( progress ) ; } ) ; fileTransfer . download ( 'http://thecatapi.com/api/images/get' , 'file.jpg' , null , shared ) ; }
Function to download a hardcoded file for demo purposes
Function to download a hardcoded file for demo purposes
// Create an instance of AWFileTransfer // Success callback // error callback // Add a progress handler // Call the AWFileTransfer.download function // Pass in the base URL, the filename, options