> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rebellapp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# my.saveImage

> Save an image to the device album.

Use this API to save an image file to the user's photo album.

## Parameters

| Property        | Type     | Required | Description                                                    |
| --------------- | -------- | -------- | -------------------------------------------------------------- |
| url             | String   | Yes      | URL of the image to be saved                                   |
| showActionSheet | Boolean  | No       | Whether to show the menu when saving image; `false` by default |
| success         | Function | No       | Callback on success                                            |
| fail            | Function | No       | Callback on failure                                            |
| complete        | Function | No       | Callback that always executes                                  |

## Code Example

```javascript theme={null}
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' });
  }
});
```

## Error Codes

| Code | Description                                        |
| ---- | -------------------------------------------------- |
| 2    | Invalid parameter, no url parameter transferred    |
| 15   | Album right not enabled (iOS only)                 |
| 16   | Insufficient album storage on cellphone (iOS only) |
| 17   | Other errors during picture saving                 |

## Related APIs

<CardGroup cols={2}>
  <Card title="my.chooseImage" icon="images" href="/jsapi/media/image/my.chooseImage">
    Choose images
  </Card>

  <Card title="my.downloadFile" icon="download" href="/jsapi/network/my.downloadFile">
    Download file
  </Card>
</CardGroup>
