Skip to main content
Version: Next

Taro.saveImageToPhotosAlbum(option)

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

Reference

Type

(option: Option) => Promise<CallbackResult>

Parameters

Option

PropertyTypeRequiredDescription
filePathstringYesThe 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) => voidNoThe callback function used when the API call completed (always executed whether the call succeeds or fails)
fail(res: any) => voidNoThe callback function for a failed API call
success(res: Result) => voidNoThe callback function for a successful API call

Sample Code

Taro.saveImageToPhotosAlbum({
success: function (res) { }
})

API Support

APIWeChat Mini-ProgramBaidu Smart-ProgramAlipay Mini-ProgramH5React Native
Taro.saveImageToPhotosAlbum✔️✔️✔️✔️