Appwrite icon

Appwrite

Interact with Appwrite API

Actions181

Storage → Create Bucket

AI-generated

Overview

This node operation creates a new storage bucket in the Appwrite platform. It is useful for organizing and managing files in a cloud storage environment, allowing users to define bucket-specific settings such as permissions, file security, and file handling options. Practical applications include setting up storage for user uploads, backups, or media assets with customized access control and security features.

Use Case Examples

  1. Creating a new bucket for storing user profile images with specific read permissions.
  2. Setting up a bucket with file-level security enabled and virus scanning for uploaded documents.

Properties

Name Meaning
Bucket ID The unique identifier for the storage bucket, which can be auto-generated using unique().
Name The display name of the bucket, required for identification.
Permissions A JSON array of permission strings that define access control for the bucket.
File Security Boolean flag to enable or disable file-level security within the bucket.
Enabled Boolean flag to enable or disable the bucket itself.
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 to apply to files in the bucket, with options None, Gzip, or Zstd.
Options.Encryption Boolean flag to enable or disable encryption of files in the bucket.
Options.Antivirus Boolean flag to enable or disable virus scanning for files in the bucket.

Output

JSON

  • bucketId - The unique identifier of the created storage bucket.
  • name - The name of the created bucket.
  • permissions - The permissions set on the bucket.
  • fileSecurity - Indicates if file-level security is enabled.
  • enabled - Indicates if the bucket is enabled.
  • options
    • maximumFileSize - 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 Appwrite API credentials are correctly configured and have permissions to create storage buckets.
  • Verify that the bucket ID is unique to avoid conflicts.
  • Check that the permissions JSON is correctly formatted to prevent API errors.
  • If file uploads fail, verify that the maximum file size and allowed file extensions settings are appropriate.
  • If encryption or antivirus scanning is enabled, ensure the Appwrite server supports these features and they are properly configured.

Discussion