晴川云小程序教程:微信小程序API 文件·获取本地文件信息

wx.getSavedFileInfo(Object object)

获取本地文件的文件信息。此接口只能用于获取已保存到本地的文件,若需要获取临时文件信息,请使用 wx.getFileInfo() 接口。

参数

Object object

属性 类型 默认值 必填 说明
filePath string 文件路径 (本地路径)
success function 接口调用成功的回调函数
fail function 接口调用失败的回调函数
complete function 接口调用结束的回调函数(调用成功、失败都会执行)

object.success 回调函数

参数
Object res
属性 类型 说明
size number 文件大小,单位 B
createTime number 文件保存时的时间戳,从1970/01/01 08:00:00 到该时刻的秒数

示例代码

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

原创文章,作者:晴川运维,如若转载,请注明出处:https://baike.qcidc.com/15060.html

(0)
晴川运维晴川运维
上一篇 2025年10月9日
下一篇 2025年10月9日

相关推荐

发表回复

登录后才能评论