---
title: "Preview a file"
method: GET
path: "/resources/preview"
tags: ["Resources"]
---

# Preview a file

`GET /resources/preview`

Returns a resized image of the specified document for supported file types.

Image data returned is encoded in base64 format and can be viewed using the `<img>` element. 

```<img src='data:image/jpeg;base64' + meta.image/>```

**Notes:**
- Supported files types are `'jpg'`, `'jpeg'`, `'gif'`, `'png'`, `'bmp'`, `'pdf'`, `'psd'`, `'doc'`

## Query parameters

- `resource` string, required
- `size` 'small' | 'medium' | 'large', required
- `width` integer
- `height` integer
- `page` integer

## Headers

- `ev-api-key` string, required
- `ev-access-token` string, required

## Response `200`

Successful Operation

- PreviewFileResponse — Response object for preview file
  - `responseStatus` integer — HTTP Status Code
  - `data` PreviewFile — Object with preview image properties.
    - `id` integer
    - `type` string
    - `attributes` object
      - `image` string — Binary image content, base64 encoded.
      - `size` integer — Size of the image in bytes.
      - `imageHash` string — hash of the image.
      - `pageCount` integer — Amount of pages available in the file. Used only for multipage documents.

---

[API](https://skmtc.net/prismic/apis/exavault-api.md) · [All operations](https://skmtc.net/prismic/apis/exavault-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/prismic/exavault-api/revisions/a1bd874b5960/schema)
