File APIs

getSavedFileInfo

Get information about a saved file.

Overview

my.getSavedFileInfo retrieves information about a file that was previously saved using my.saveFile. The saved address is required to use this API.

Sample Code

my.chooseImage({
  success: (res) => {
    console.log(res.apFilePaths[0], 1212);
    my.saveFile({
      apFilePath: res.apFilePaths[0],
      success: (result) => {
        console.log(result, 1212);
        my.getSavedFileInfo({
          apFilePath: result.apFilePath,
          success: (resu) => {
            console.log(JSON.stringify(resu));
          }
        });
      },
    });
  },
});

Parameters

Object type with the following attributes:

PropertyTypeRequiredDescription
apFilePathStringYesFile path.
successFunctionNoCallback function upon call success.
failFunctionNoCallback function upon call failure.
completeFunctionNoCallback function upon call completion (to be executed upon either call success or failure).

Success Callback Function

The incoming parameter is of the Object type with the following attributes:

PropertyTypeDescription
sizeNumberFile size.
createTimeNumberTimestamp for the created time.

Usage Notes

  • The file must be previously saved using my.saveFile
  • Use the apFilePath returned from my.saveFile as the input
  • Returns file size and creation timestamp