Appwrite
  1. storage
Appwrite
  • account
    • Delete Account
      DELETE
    • Get Account
      GET
    • Create Account
      POST
    • Update Account Email
      PATCH
    • Create Account JWT
      POST
    • Get Account Logs
      GET
    • Update Account Name
      PATCH
    • Update Account Password
      PATCH
    • Get Account Preferences
      GET
    • Update Account Preferences
      PATCH
    • Create Password Recovery
      POST
    • Complete Password Recovery
      PUT
    • Delete All Account Sessions
      DELETE
    • Get Account Sessions
      GET
    • Create Account Session
      POST
    • Create Anonymous Session
      POST
    • Create Account Session with OAuth2
      GET
    • Delete Account Session
      DELETE
    • Get Session By ID
      GET
    • Create Email Verification
      POST
    • Complete Email Verification
      PUT
  • avatars
    • Get Browser Icon
    • Get Credit Card Icon
    • Get Favicon
    • Get Country Flag
    • Get Image from URL
    • Get User Initials
    • Get QR Code
  • database
    • List Documents
    • Create Document
    • Delete Document
    • Get Document
    • Update Document
  • functions
    • List Executions
    • Create Execution
    • Get Execution
  • locale
    • Get User Locale
    • List Continents
    • List Countries
    • List EU Countries
    • List Countries Phone Codes
    • List Currencies
    • List Languages
  • storage
    • List Files
      GET
    • Create File
      POST
    • Delete File
      DELETE
    • Get File
      GET
    • Update File
      PUT
    • Get File for Download
      GET
    • Get File Preview
      GET
    • Get File for View
      GET
  • teams
    • List Teams
    • Create Team
    • Delete Team
    • Get Team
    • Update Team
    • Get Team Memberships
    • Create Team Membership
    • Delete Team Membership
    • Update Membership Roles
    • Update Team Membership Status
  1. storage

Get File Preview

GET
/storage/files/{fileId}/preview
storage
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.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://appwrite.io/v1/storage/files//preview'
Response Response Example
{}

Request

Path Params
fileId
string 
required
File unique ID
Query Params
width
integer 
optional
Resize preview image width, Pass an integer between 0 to 4000.
height
integer 
optional
Resize preview image height, Pass an integer between 0 to 4000.
gravity
string 
optional
Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right
quality
integer 
optional
Preview image quality. Pass an integer between 0 to 100. Defaults to 100.
borderWidth
integer 
optional
Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.
borderColor
string 
optional
Preview image border color. Use a valid HEX color, no # is needed for prefix.
borderRadius
integer 
optional
Preview image border radius in pixels. Pass an integer between 0 to 4000.
opacity
number 
optional
Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.
rotation
integer 
optional
Preview image rotation in degrees. Pass an integer between 0 and 360.
background
string 
optional
Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.
output
string 
optional
Output format type (jpeg, jpg, png, gif and webp).

Responses

🟢200Image
application/json
Body
object {0}
Modified at 2023-08-16 07:28:13
Previous
Get File for Download
Next
Get File for View
Built with