Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat Small Program API File - Get a list of saved local cached files


May 19, 2021 WeChat Mini Program Development Document


Table of contents


wx.getSavedFileList(Object object)

Gets a list of local cached files saved under the small program

Parameters

Object object

Property Type The default Required Description
success function Whether The interface calls a successful callback function
fail function Whether The interface calls the failed callback function
complete function Whether Callback function at end of interface call (call succeeds, fails are executed)

object.success callback function

Parameters
Object res
Property Type Description
fileList Array.<Object> An array of files, each of which is a FileItem

The structure of res.fileList

Property Type Description
filePath string File path (local path)
size number The local file size, in bytes
createTime number The timestamp at the time the file was saved, from 1970/01/01 08:00:00 to the number of seconds of the current time

The sample code

wx.getSavedFileList({
  success (res) {
    console.log(res.fileList)
  }
})