Skip to content

Instantly share code, notes, and snippets.

@optikalefx
Created September 19, 2016 10:49
Show Gist options
  • Save optikalefx/52552f44c09b928bc057a8eff68c72fc to your computer and use it in GitHub Desktop.
Save optikalefx/52552f44c09b928bc057a8eff68c72fc to your computer and use it in GitHub Desktop.
let url = `cdvfile://localhost/persistent/...mySavedFile.jpg`;
let options = new window.FileUploadOptions();
options.fileKey = 'bizCard';
options.fileName = url.substr(url.lastIndexOf('/') + 1);
options.mimeType = 'image/jpeg';
let ft = new window.FileTransfer();
let apiType = 'myAPIUrl';
ft.upload(url, myAPIUrl, (r) => {
console.log('success', r);
}, (e) => {
console.log('error', e);
}, options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment