getFile


Purpose

Enables aquiring a file from various file sources available on the device.

Signature

getFile(callbacks)

Returns

This method does not return anything.

Parameters

Name Description Type Use
callbacks

Passed to verify whether it is possible to acquire a file.

undefined required

The getFile method's callbacks object can be structured as follows:

{
  onSuccess: function(result)
    {
      printText('File chooser success : ' + result.filePath + ' ' + result.fileSize)
    },
  onFailure: function(error) {...}
}

The table below lists all callbacks supported by the method.

Name Description Type Use
onSuccess()

A function called when the process succeeds. As a parameter it takes an object with the following two properties:

  • result.filePath - a File API-compatible path to the acquired file,

  • result.fileSize - a size of the file in bytes.

function required
onFailure() A function called when the file cannot be acquired. It passes an error message. function required

Related topics

Overview
Legal notice | Copyright © 2017 and Confidential to Pegasystems Inc. All rights reserved
PDN | Feedback
Advanced...