title: Taro.saveImageToPhotosAlbum(option)

sidebar_label: saveImageToPhotosAlbum

Saves images to the system album. User Authorization is required for scope.writePhotosAlbum before this API is called.

Reference

Type

  1. (option: Option) => Promise<CallbackResult>

Parameters

Option

Property Type Required Description
filePath string Yes The path to the image file. It can be a temporary or permanent file path. The path to a network image is not supported.
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

Sample Code

  1. Taro.saveImageToPhotosAlbum({
  2. success: function (res) { }
  3. })

API Support

API WeChat Mini-Program Baidu Smart-Program Alipay Mini-Program H5 React Native
Taro.saveImageToPhotosAlbum ✔️ ✔️ ✔️ ✔️