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

# Download Image

> Download a generated try-on image as a file

Proxy-download a generated image from storage. Useful in iframe/cross-origin contexts where direct storage downloads are blocked by CORS.

## Query Parameters

<ParamField query="url" type="string" required>
  Image URL from Genlook storage (GCS). Must point to the Genlook bucket.
</ParamField>

<ParamField query="filename" type="string">
  Download filename. Defaults to `"Genlook - Your Try On.jpg"`.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://your-store.myshopify.com/apps/proxy_genlook-x/public/download-image?url=https://storage.googleapis.com/bucket-name/image.jpg&filename=My%20Try%20On.jpg" \
    --output downloaded-image.jpg
  ```

  ```javascript JavaScript theme={null}
  const downloadUrl = `/apps/proxy_genlook-x/public/download-image?url=${encodeURIComponent(imageUrl)}&filename=${encodeURIComponent(filename)}`;

  const link = document.createElement('a');
  link.href = downloadUrl;
  link.download = filename;
  link.click();
  ```
</RequestExample>

## Response

Binary image file with `Content-Disposition: attachment` headers.

<ResponseExample>
  ```http Success theme={null}
  HTTP/1.1 200 OK
  Content-Type: image/jpeg
  Content-Disposition: attachment; filename="Genlook - Your Try On - T-Shirt.jpg"
  Content-Length: 245678

  [binary image data]
  ```
</ResponseExample>
