---
title: "Preview"
method: GET
path: "/2/drive/{drive_id}/files/{file_id}/preview"
tags: ["Drive > Files > File/Directory"]
---

# Preview

`GET /2/drive/{drive_id}/files/{file_id}/preview`

Get file preview.

## Path parameters

- `drive_id` integer, required
- `file_id` integer, required

## Query parameters

- `as` 'pdf' | 'text' — Convert file before preview
- `height` integer — The height of the preview. <note>This parameter only works on image</note>
- `quality` integer — The quality of the preview. <note>This parameter only works on image</note>
- `version_id` integer — Version identifier of this file
- `width` integer — The width of the preview. <note>This parameter only works on image</note>

## Headers

- `x-kdrive-file-password` string — File password to open it for conversion, if the file is password-protected

## Response `200`

OK

## Other responses

- `403` — Forbidden
- `503` — Service Unavailable

---

[API](https://skmtc.dev/infomaniak/apis/api-reference-developer-tools.md) · [All operations](https://skmtc.dev/infomaniak/apis/api-reference-developer-tools/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/infomaniak/api-reference-developer-tools/revisions/667aae28fec6/schema)
