All Products
Search
Document Center

SuperApp:Save image

Last Updated:May 27, 2026

WVImage.saveImage saves an image to the device album from an HTTP/HTTPS URL or a Base64-encoded string. Use this API in H5 applications and miniapps built on the WindVane platform.

WVImage.saveImage

Saves an image to the device album. The image source can be an HTTP or HTTPS URL, or a Base64-encoded string.

Syntax

var params = {
    // URL of the image to save. Supports HTTP, HTTPS, and Base64-encoded strings.
    url: 'https://gw.xxx.com/xxx/xxx.png',
};
window.WindVane.call('WVImage', 'saveImage', params, function() {
    alert('saveImage success');
}, function(e) {
    alert('saveImage failure: ' + JSON.stringify(e));
});

Parameters

Property

Type

Required

Description

url

String

Yes

The URL of the image to save. Accepts HTTP URLs, HTTPS URLs, and Base64-encoded strings.

Callbacks

The success callback fires when the operation succeeds. The failure callback fires when the operation fails and receives the following parameter:

Property

Type

Description

msg

String

The error message describing the failure reason.