File APIs

removeSavedFile

Delete a saved file.

Overview

my.removeSavedFile deletes a file that was previously saved using my.saveFile.

Sample Code

my.getSavedFileList({
  success: (res) => {
    my.removeSavedFile({
      apFilePath: res.fileList[0].apFilePath,
      success: (res) => {
        console.log('remove success');
      }
    });
  }
});

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

Usage Notes

  • The file must be previously saved using my.saveFile
  • Use the apFilePath from my.getSavedFileList or my.saveFile response
  • Once removed, the file cannot be recovered
  • Removing a file frees up storage space from the 10 MB limit