Skip to main content

File Metadata Plugin

The File Metadata Extractor plugin for Bubble makes it simple to retrieve essential metadata from file URLs.

Written by Kiaan
Updated over a year ago

How It Works:

The File Metadata Extractor plugin extracts metadata based on the type of file (video, audio, or image). It automatically detects the file type and retrieves the following information:

Supported File Types:

  • Video Files: .mp4, .webm, .ogg

  • Audio Files: .mp3, .wav, .ogg

  • Image Files: .jpg, .jpeg, .png, .gif, .bmp, .webp

📦 Metadata Extracted:

🎥 For Video and Audio Files:

  • Duration: Retrieves the duration of video or audio content.

  • File Size: Fetches the size of the file in bytes.

  • File Type: Identifies the type of file (e.g., mp4, mp3).

🖼️ For Image and Video Files:

  • Height & Width: Extracts the dimensions of the file, useful for managing image or video content.

  • File Size: Fetches the size of the image or video file in bytes.

Plugin Workflow:

  1. File Type Detection: The plugin validates the file type from the URL provided. It supports video, audio, and image file types.

  2. Metadata Extraction:

    • For video files, it retrieves duration, width, and height.

    • For audio files, it retrieves the duration.

    • For image files, it retrieves the width and height.

  3. File Size Retrieval: For all file types, the file size is fetched by making a HEAD request to the file URL.

  4. Events: The plugin triggers a metadataReady event when the data is successfully retrieved, making it easy to integrate with your app's workflow.

Usage:

  • Add the File Metadata Extractor element to your Bubble page.

  • Provide the File URL as a property.

  • The plugin will return metadata like file size, type, dimensions, and duration when applicable.

  • Use the event metadataReady to execute actions once the metadata is available.

Did this answer your question?