Skip to main content
Use this API to save an image file to the user’s photo album.

Parameters

PropertyTypeRequiredDescription
urlStringYesImage URL or local path
successFunctionNoCallback on success
failFunctionNoCallback on failure
completeFunctionNoCallback that always executes

Code Example

my.saveImage({
  url: 'https://example.com/image.jpg',
  success: () => {
    my.showToast({ content: 'Saved to album', type: 'success' });
  },
  fail: () => {
    my.showToast({ content: 'Save failed', type: 'fail' });
  }
});

my.chooseImage

Choose images

my.downloadFile

Download file