GET /storage/files/{fileId}/preview

appwrite.io:client

Summary: Get File Preview
Operation ID: storageGetFilePreview
Auth: custom_header
Description

Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image.

Parameters (12)

background (string, query, optional)

Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.

borderColor (string, query, optional)

Preview image border color. Use a valid HEX color, no # is needed for prefix.

borderRadius (integer, query, optional, default: 0)

Preview image border radius in pixels. Pass an integer between 0 to 4000.

borderWidth (integer, query, optional, default: 0)

Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.

fileId (string, path, required)

File unique ID

gravity (string, query, optional, default: center)

Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right

height (integer, query, optional, default: 0)

Resize preview image height, Pass an integer between 0 to 4000.

opacity (number, query, optional, default: 1)

Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.

output (string, query, optional)

Output format type (jpeg, jpg, png, gif and webp).

quality (integer, query, optional, default: 100)

Preview image quality. Pass an integer between 0 to 100. Defaults to 100.

rotation (integer, query, optional, default: 0)

Preview image rotation in degrees. Pass an integer between 0 and 360.

width (integer, query, optional, default: 0)

Resize preview image width, Pass an integer between 0 to 4000.

No probe data for this endpoint yet.