Actions181
- Account Actions
- Get Account
- Create Account
- Update Email
- Update Name
- Update Password
- Update Phone
- Update Status
- Get Preferences
- Update Preferences
- List Sessions
- Delete Sessions
- Get Session
- Update Session
- Delete Session
- Create Anonymous Session
- Create Email/Password Session
- Create Magic URL Session
- Create OAuth2 Session
- Create Phone Session
- Create Session from Token
- Create JWT
- Create Magic URL
- Create Phone Token
- Create Email Verification
- Update Email Verification
- Create Phone Verification
- Update Phone Verification
- Create Password Recovery
- Update Password Recovery
- Create Recovery
- Update Recovery
- Update MFA
- Create MFA Authenticator
- Update MFA Authenticator
- Delete MFA Authenticator
- Create MFA Challenge
- Update MFA Challenge
- Attribute Actions
- Avatars Actions
- Collection Actions
- Database Actions
- Document Actions
- Functions Actions
- Index Actions
- Locale Actions
- Messaging Actions
- Sites Actions
- Storage Actions
- Teams Actions
- Users Actions
Storage → Get File Preview
AI-generatedOverview
This node interacts with the Appwrite API to retrieve a preview of a file stored in an Appwrite storage bucket. It is useful for scenarios where users need to generate and obtain image previews or thumbnails of stored files with customizable options such as size, cropping, quality, borders, opacity, rotation, background color, and output format. Practical examples include generating image previews for display in web applications, resizing images for thumbnails, or applying visual effects before further processing or sharing.
Use Case Examples
- Generating a 200x200 pixel preview of an image file with a centered crop and 80% quality for use in a web gallery.
- Creating a circular preview of a profile picture with a border and transparent background for user avatars.
- Obtaining a rotated and resized preview of a document thumbnail for display in a document management system.
Properties
| Name | Meaning |
|---|---|
| Bucket ID | The ID of the storage bucket where the file is stored. |
| File ID | The ID of the file to retrieve the preview for. |
| Preview Options | Various options to customize the file preview, including width, height, crop gravity, quality, border width, border color, border radius, opacity, rotation, background color, and output format. |
Output
JSON
previewUrl- URL of the generated file preview image.
Dependencies
- Appwrite API key credential for authentication and access to the storage service.
Troubleshooting
- Ensure the provided Bucket ID and File ID are correct and exist in the Appwrite storage service to avoid 'file not found' errors.
- Verify that the API key credential has sufficient permissions to access the storage bucket and retrieve file previews.
- Check that the preview options are within valid ranges (e.g., quality between 0-100, opacity between 0-1, rotation between 0-360) to prevent errors or unexpected results.
- If the preview generation fails, confirm that the file type supports preview generation and that the Appwrite storage service is operational.
Links
- Appwrite Storage Documentation - Official documentation for Appwrite Storage service including file preview capabilities.