https://appwrite.io/v1/storage/files/{fileId}/previewGet 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.
File unique ID
Resize preview image width, Pass an integer between 0 to 4000.
Resize preview image height, Pass an integer between 0 to 4000.
Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right
Preview image quality. Pass an integer between 0 to 100. Defaults to 100.
Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.
Preview image border color. Use a valid HEX color, no # is needed for prefix.
Preview image border radius in pixels. Pass an integer between 0 to 4000.
Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.
Preview image rotation in degrees. Pass an integer between 0 and 360.
Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.
Output format type (jpeg, jpg, png, gif and webp).
{
"success": true,
"data": {
"id": "abc123",
"created_at": "2025-01-01T00:00:00Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters"
}
}1curl --request GET \2 --url 'https://appwrite.io/v1/storage/files/{fileId}/preview' \3 --header 'accept: application/json' \4 --header 'content-type: application/json'1{2 "success": true,3 "data": {4 "id": "abc123",5 "created_at": "2025-01-01T00:00:00Z"6 }7}https://appwrite.io/v1/storage/files/{fileId}/previewGet 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.
File unique ID
Resize preview image width, Pass an integer between 0 to 4000.
Resize preview image height, Pass an integer between 0 to 4000.
Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right
Preview image quality. Pass an integer between 0 to 100. Defaults to 100.
Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.
Preview image border color. Use a valid HEX color, no # is needed for prefix.
Preview image border radius in pixels. Pass an integer between 0 to 4000.
Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.
Preview image rotation in degrees. Pass an integer between 0 and 360.
Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.
Output format type (jpeg, jpg, png, gif and webp).
{
"success": true,
"data": {
"id": "abc123",
"created_at": "2025-01-01T00:00:00Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters"
}
}1curl --request GET \2 --url 'https://appwrite.io/v1/storage/files/{fileId}/preview' \3 --header 'accept: application/json' \4 --header 'content-type: application/json'1{2 "success": true,3 "data": {4 "id": "abc123",5 "created_at": "2025-01-01T00:00:00Z"6 }7}