Appwrite icon

Appwrite

Interact with Appwrite API

Actions181

Storage → Update Bucket

AI-generated

Overview

This node operation updates an existing storage bucket in the Appwrite platform. It allows users to modify bucket properties such as the bucket's name, permissions, file security settings, enabled status, and various options like maximum file size, allowed file extensions, compression method, encryption, and antivirus scanning. This operation is useful for managing storage buckets dynamically, for example, adjusting security settings or file restrictions as project requirements evolve.

Use Case Examples

  1. Updating a bucket to change its name and enable file-level security.
  2. Modifying permissions of a bucket to restrict or allow access.
  3. Setting file size limits and allowed file types for uploads to a bucket.

Properties

Name Meaning
Bucket ID The unique identifier of the storage bucket to update.
Name The new name to assign to the bucket.
Permissions An array of permission strings defining access control for the bucket.
File Security Boolean flag to enable or disable file-level security within the bucket.
Enabled Boolean flag indicating whether the bucket is active or disabled.
Options.Maximum File Size Maximum allowed file size in bytes for files uploaded to the bucket.
Options.Allowed File Extensions Comma-separated list of allowed file extensions for files in the bucket; empty means all extensions allowed.
Options.Compression Compression algorithm applied to files in the bucket.
Options.Encryption Boolean flag to enable or disable encryption of files in the bucket.
Options.Antivirus Boolean flag to enable or disable virus scanning of files in the bucket.

Output

JSON

  • bucketId - The ID of the updated storage bucket.
  • name - The updated name of the bucket.
  • permissions - The updated permissions array for the bucket.
  • fileSecurity - Indicates if file-level security is enabled.
  • enabled - Indicates if the bucket is enabled.
  • options
    • maximumFileSize - The maximum file size allowed in the bucket.
    • allowedFileExtensions - Allowed file extensions for files in the bucket.
    • compression - Compression algorithm used for the bucket.
    • encryption - Indicates if encryption is enabled for files in the bucket.
    • antivirus - Indicates if antivirus scanning is enabled for files in the bucket.

Dependencies

  • Appwrite API key credential

Troubleshooting

  • Ensure the Bucket ID provided is correct and exists; otherwise, the update will fail.
  • Verify that the permissions array is properly formatted as JSON and contains valid permission strings.
  • If file security or encryption options are enabled, confirm that the Appwrite project supports these features.
  • Check that the maximum file size and allowed file extensions are set according to your storage requirements to avoid upload errors.
  • Common error messages may include authentication failures if the API key is invalid or missing, or permission denied errors if the user lacks rights to update the bucket.

Links

Discussion