# How to Handle Blob Storage in Bubble

- Tool: Bubble
- Difficulty: Beginner
- Time required: 20-25 min
- Compatibility: All Bubble plans (external storage requires API Connector)
- Last updated: March 2026

## TL;DR

Bubble stores uploaded files on Amazon S3 behind the scenes, but for large files or high-volume storage needs, connecting to an external blob storage service gives you more control and better pricing. This tutorial covers Bubble's built-in file handling, connecting to AWS S3 or Azure Blob Storage via the API Connector, uploading files to external storage, and retrieving them with signed URLs.

## Overview: Blob Storage in Bubble

This tutorial explains how to manage large binary files in your Bubble app. You will learn about Bubble's native file storage, when to use external blob storage services, how to set up AWS S3 or Azure Blob Storage via the API Connector, and how to implement secure file upload and retrieval workflows.

## Before you start

- A Bubble app that needs to store large files
- An AWS or Azure account for external storage (optional)
- API Connector plugin installed in your Bubble app
- Basic understanding of REST APIs and authentication headers

## Step-by-step guide

### 1. Understand Bubble's built-in file storage

Bubble automatically stores uploaded files on Amazon S3 and serves them via CDN. Files uploaded through the File Uploader or Picture Uploader are stored and referenced by URL in your database. The storage limits depend on your plan: Free = 0.5 GB, Starter = 10 GB, Growth = 100 GB, Team = 1 TB. You can view and manage stored files in the Data tab → File manager. Bubble's built-in storage works for most apps, but large file volumes or files over 50MB may require external storage.

**Expected result:** You understand Bubble's built-in storage model, limits, and when external storage is needed.

### 2. Set up AWS S3 as external blob storage

In the Plugins tab, open the API Connector. Create a new API called 'AWS_S3'. Set authentication to 'None / self-handled' since you will add AWS Signature headers manually. For a simpler approach, create a backend API workflow that generates a pre-signed upload URL using an AWS Lambda function or a third-party service like Uploadcare. The pre-signed URL lets the browser upload directly to S3 without exposing your AWS credentials.

```
{
  "bucket": "your-bucket-name",
  "key": "uploads/user-files/{{filename}}",
  "content_type": "application/octet-stream",
  "expiration": 3600
}
```

> Pro tip: Never store AWS access keys in Bubble's client-side code. Use a backend workflow or Lambda function to generate pre-signed URLs.

**Expected result:** AWS S3 is configured as an external storage destination with secure upload URLs generated server-side.

### 3. Create a file upload workflow to external storage

Add a File Uploader element on your page. When the user selects a file, trigger a workflow that: Step 1 — calls your backend workflow to get a pre-signed S3 upload URL. Step 2 — uses the API Connector to PUT the file to the pre-signed URL (set the file as the body, content-type matching the file type). Step 3 — stores the S3 file URL in your database on the relevant record. For files under 50MB, you can upload through Bubble's native uploader first, then transfer to S3 via a backend workflow.

**Expected result:** Files upload directly from the browser to S3 using pre-signed URLs, with the file location stored in your Bubble database.

### 4. Retrieve files with signed URLs for secure access

For private files that should not be publicly accessible, generate signed download URLs. Create a backend API workflow that takes a file key as a parameter, generates a pre-signed GET URL from S3 with an expiration time (e.g., 1 hour), and returns the URL. On the frontend, call this workflow when the user clicks a download or view button. The signed URL gives temporary access without exposing the file publicly.

**Expected result:** Private files are accessible only through temporary signed URLs that expire after a set time period.

### 5. Optimize file storage and retrieval performance

For large files, implement chunked uploads by splitting files into parts and uploading them sequentially. Use S3's multipart upload API for files over 100MB. For frequently accessed files, enable CloudFront CDN in front of your S3 bucket. Store file metadata (size, type, upload date) in your Bubble database while keeping the actual file in S3. This gives you fast metadata queries without loading large files.

**Expected result:** Large files upload reliably with chunked transfers, and frequently accessed files load quickly via CDN.

## Complete code example

File: `Workflow summary`

```text
BLOB STORAGE — WORKFLOW SUMMARY
=================================

BUBBLE BUILT-IN STORAGE:
  File Uploader → auto-stores on Bubble S3
  URL stored in database field (file/image type)
  Limits: Free 0.5GB, Starter 10GB, Growth 100GB

EXTERNAL S3 SETUP:
  1. Create S3 bucket with appropriate permissions
  2. Set up pre-signed URL generation (Lambda/backend)
  3. API Connector: call pre-sign endpoint
  4. Upload file directly from browser to S3
  5. Store S3 URL in Bubble database

UPLOAD WORKFLOW:
  Step 1: User selects file via File Uploader
  Step 2: Backend workflow → generate pre-signed URL
  Step 3: API Connector PUT → file to S3
  Step 4: Store S3 URL on database record

DOWNLOAD WORKFLOW (private files):
  Step 1: User clicks download button
  Step 2: Backend workflow → generate signed GET URL
  Step 3: Redirect browser to signed URL
  Signed URL expires after set time (1 hour)

OPTIMIZATION:
  - CloudFront CDN for frequently accessed files
  - Multipart upload for files > 100MB
  - Store metadata in Bubble, files in S3
  - Set lifecycle rules to archive old files
```

## Common mistakes

- **Storing AWS credentials in client-side Bubble workflows** — Client-side code is visible to users — exposed AWS keys can be used to access or delete your entire S3 bucket Fix: Generate pre-signed URLs in backend workflows or AWS Lambda functions, never in frontend workflows
- **Making S3 buckets publicly accessible for convenience** — Public buckets expose all files to anyone with the URL, creating data privacy and security risks Fix: Keep buckets private and use pre-signed URLs for controlled, time-limited access
- **Not setting file size limits on the uploader** — Extremely large uploads can time out, consume excessive bandwidth, and fill storage quotas Fix: Validate file size before upload and set maximum limits appropriate for your use case

## Best practices

- Use Bubble's built-in storage for files under 50MB and moderate storage volumes
- Switch to external S3 or Azure storage when you need more than 10GB or handle files over 50MB
- Always use pre-signed URLs for uploads and downloads to keep credentials secure
- Store file metadata in Bubble's database while keeping actual files in external storage
- Set S3 lifecycle rules to automatically archive or delete old files
- Enable CloudFront CDN for frequently accessed files to improve download speed
- Monitor storage costs monthly — S3 is significantly cheaper than Bubble's per-plan storage pricing at scale

## Frequently asked questions

### When should I use external storage instead of Bubble's built-in storage?

Consider external storage when: your files exceed 50MB, you need more than 10GB total storage, you want granular access controls, or you need CDN distribution for performance.

### Can I use Google Cloud Storage or Azure instead of AWS S3?

Yes. Both Google Cloud Storage and Azure Blob Storage have similar REST APIs that you can connect via the API Connector. The pre-signed URL pattern works the same across all three.

### How much does external S3 storage cost compared to Bubble?

S3 charges about $0.023 per GB/month for standard storage. For 100GB, that is $2.30/month compared to needing a Growth plan ($119/month) for the same storage on Bubble.

### Can users upload files directly to S3 from a Bubble app?

Yes, using pre-signed URLs. Your backend generates a temporary upload URL, and the browser uploads directly to S3 without the file passing through Bubble's servers.

### Can RapidDev set up external storage integration for my Bubble app?

Yes. RapidDev can configure AWS S3, Azure Blob, or Google Cloud Storage with secure upload/download workflows, CDN distribution, and lifecycle management for your Bubble app.

---

Source: https://www.rapidevelopers.com/bubble-tutorial/handle-blob-storage-in-bubble
© RapidDev — https://www.rapidevelopers.com/bubble-tutorial/handle-blob-storage-in-bubble
