May 19, 2021 WeChat Mini Program Development Document
Save the file locally. Note: SaveFile moves the temporary file, so the tempFilePath that is passed in after the call is successful will not be available
Property | Type | The default | Required | Description |
---|---|---|---|---|
tempFilePath | string | Is | Temporary path for files that need to be saved (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) |
Property | Type | Description |
---|---|---|
savedFilePath | number | Stored file path (local path) |
wx.chooseImage({
success: function(res) {
const tempFilePaths = res.tempFilePaths
wx.saveFile({
tempFilePath: tempFilePaths[0],
success (res) {
const savedFilePath = res.savedFilePath
}
})
}
})
The size of the local file store is limited to 10M