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

WeChat small program API file - get local file information


May 19, 2021 WeChat Mini Program Development Document


Table of contents


wx.getSavedFileInfo(Object object)

Get file information for local files. This interface can only be used to get files that have been saved to the local area, and if you need temporary file information, use the wx.getFileInfo() interface.

Parameters

Object object

Property Type The default Required Description
filePath string Is File path (local path)
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
size number File size, unit B
createTime number The timestamp at the time the file was saved, from 1970/01/01 08:00:00 to the number of seconds at that moment

The sample code

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