import { outbox } from 'file-transfer' ; let srcImage = 'https://placekitten.com/348/250' ; let destFilename = 'kitten.jpg' ; fetch ( srcImage ) . then ( function ( response ) { return response . arrayBuffer ( ) ; } ) . then ( function ( data ) { outbox . enqueue ( destFilename , data ) . then ( function ( ft ) { console . log ( "Transfer of '" + destFilename + "' successfully queued." ) ; } ) . catch ( function ( error ) { throw new Error ( "Failed to queue '" + destFilename + "'. Error: " + error ) ; } ) ; } ) . catch ( function ( error ) { console . log ( 'Failure: ' + error ) ; } ) ;