Taro.getSavedFileList(option)
Gets the list of local cache files saved under the Mini Program.
Type
(option?: Option) => Promise<SuccessCallbackResult>
Parameters
Option
| Property | Type | Required | Description | 
|---|---|---|---|
| complete | (res: any) => void | No | The callback function used when the API call completed (always executed whether the call succeeds or fails) | 
| fail | (res: any) => void | No | The callback function for a failed API call | 
| success | (res: Result) => void | No | The callback function for a successful API call | 
SuccessCallbackResult
| Property | Type | Description | 
|---|---|---|
| fileList | FileItem[] | File array, with each item being a FileItem | 
| errMsg | string | Call result | 
FileItem
res.fileList is composed as follows
| Property | Type | Description | 
|---|---|---|
| createTime | number | The timestamp when the file was saved, which is defined as the number of seconds that have elapsed since 1970/01/01 08:00:00 to the current time | 
| filePath | string | Local path | 
| size | number | Local file size in bytes | 
Sample Code
Taro.getSavedFileList({
  success: function (res) {
    console.log(res.fileList)
  }
})
API Support
| API | WeChat Mini-Program | H5 | React Native | 
|---|---|---|---|
| Taro.getSavedFileList | ✔️ | ✔️ |