PhoneGap File Upload Action Javascript

Description

The PhoneGap File Upload Action Javascript allows you to upload one or more files in a Cordova application from the file system on the mobile device to either the Alpha Anywhere server, or to Amazon S3.

Discussion

Uploads files from the file system on a mobile device to a server.

When you select this action, the following dialog appears:

images/phonegapfileupload.jpg
Your Cordova application must include the Device, File, File Transfer plugins.

Properties of note in this builder include:

  • Files to upload Javascript Function

    The name of a Javascript function to call. This function must return an array of fully qualified filenames.

    For example:

    return ['file:///storage/emulated/1234567.JPG']
  • Target

    Amazon S3 or the Alpha Anywhere server.

If you select multiple files to upload, the files are uploaded asynchronously. Each selected file has its on 'On Upload Complete' event. There is also an 'On Upload Complete' event that is fired once all selected files have been uploaded.

If you upload files to the Alpha Anywhere server, you can specify an Xbasic function to call after each file has been uploaded.

images/xbasic_phonegap_file_upload.gif

See Also