my.getSavedFileInfo

Get saved file information.

Supported types of mini programs: DSL, H5+

Sample Code

The my.saveFile saved address is required to use my.getSavedFileInfo.

copy
var that = this;
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))
            that.filePath = resu
          }
        })
      },
    });
  },
});

Parameters

Object type with the following attributes:

PropertyType

Required

Description
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.

Error code

Error code

Error message

Further action

2

invalid parameter

Refer to the previous Parameters table to ensure that all parameters are specified correctly, and that all required parameters are provided.

12

file does not exist

Ensure that the apFilePath parameter is specified correctly and the target file exists.