Skip to main content
RapidDev - Software Development Agency
bubble-tutorial

How to build file sharing in Bubble

Build a file sharing platform in Bubble with file upload, shareable link generation with optional expiry and password protection, access control for public and private files, and download tracking. This lets users securely share files with anyone while maintaining control over access.

What you'll learn

  • How to create a file sharing data structure with access controls
  • How to generate shareable links with optional expiry dates
  • How to add password protection to shared files
  • How to track downloads and manage shared files
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Beginner5 min read20-25 minAll Bubble plansMarch 2026RapidDev Engineering Team
TL;DR

Build a file sharing platform in Bubble with file upload, shareable link generation with optional expiry and password protection, access control for public and private files, and download tracking. This lets users securely share files with anyone while maintaining control over access.

Overview: Building a File Sharing Platform in Bubble

This tutorial shows you how to build a secure file sharing platform in Bubble. You will create data types for files and share links, build upload functionality, generate shareable URLs with optional password protection and expiry dates, track downloads, and let file owners manage their shared files.

Prerequisites

  • A Bubble account with an existing app
  • Basic understanding of Bubble data types and workflows
  • Familiarity with File Uploader element and URL parameters
  • Knowledge of Privacy Rules basics

Step-by-step guide

1

Create the file sharing data types

Go to the Data tab and create: SharedFile with fields: owner (User), file (file), filename (text), description (text), file_size (text), upload_date (date). ShareLink with fields: shared_file (SharedFile), access_code (text — unique generated code), password (text — optional), expiry_date (date — optional), is_active (yes/no), download_count (number, default 0), max_downloads (number — optional limit).

Expected result: SharedFile and ShareLink data types exist with all access control fields.

2

Build the upload and share interface

Create a page called my-files. Add a File Uploader and Input fields for filename and description. The upload workflow creates a SharedFile record. Below, add a Repeating Group showing the user's files. Each cell has a Share button that opens a popup where the user can set: password (optional), expiry date (optional), and max downloads (optional). On share, create a ShareLink with a generated access_code (use a random string or truncated unique ID) and the configured options.

Expected result: Users can upload files and generate share links with configurable access controls.

3

Create the download page

Create a page called download that reads the access_code from a URL parameter. On page load, search for ShareLink where access_code = URL parameter code and is_active = yes. If not found, show File not found. If found but expired (expiry_date < Current date), show Link expired. If password-protected, show a password input. On correct password, reveal the Download button. The download workflow opens the file URL and increments download_count. If max_downloads is set and reached, set is_active = no.

Expected result: Anyone with the share link can download the file, subject to password, expiry, and download limit controls.

4

Add file management for owners

On the my-files page, add management controls: a toggle to deactivate share links (set is_active = no), a delete button for removing files entirely, and a stats view showing download_count per share link. For each file, show all its ShareLinks in an expandable section. Let owners revoke access to any share link at any time. For enterprise file sharing with team folders and audit logs, consider working with RapidDev.

Expected result: File owners can manage, monitor, and revoke access to their shared files.

Complete working example

Workflow summary
1FILE SHARING PLATFORM WORKFLOW SUMMARY
2==========================================
3
4DATA TYPES:
5 SharedFile: owner, file, filename, description, file_size, upload_date
6 ShareLink: shared_file, access_code, password, expiry_date, is_active, download_count, max_downloads
7
8SHARE URL FORMAT:
9 https://yourapp.com/download?code=[access_code]
10
11WORKFLOW 1: Upload file
12 Action: Create SharedFile (owner=Current User, file=Uploader's value)
13
14WORKFLOW 2: Generate share link
15 Action 1: Create ShareLink
16 access_code = generated unique string
17 password = Input Password's value (if set)
18 expiry_date = Date Picker's value (if set)
19 is_active = yes
20 Action 2: Display the share URL
21
22WORKFLOW 3: Download file
23 Page: download?code=[access_code]
24 Check 1: ShareLink exists and is_active = yes
25 Check 2: Not expired (expiry_date >= Current date or empty)
26 Check 3: Password matches (if set)
27 Check 4: download_count < max_downloads (if set)
28 Action 1: Open file URL
29 Action 2: Increment download_count
30 Action 3: If max_downloads reached is_active = no
31
32WORKFLOW 4: Revoke access
33 Action: Make changes to ShareLink (is_active = no)

Common mistakes when building file sharing in Bubble

Why it's a problem: Using predictable access codes

How to avoid: Generate access codes using a long random string or a combination of the unique ID and a timestamp.

Why it's a problem: Not checking expiry dates on the download page

How to avoid: Check expiry_date on page load and show an expired message if the current date is past the expiry.

Why it's a problem: Not setting Privacy Rules on SharedFile

How to avoid: Add Privacy Rules so only the file owner can find their files in searches. ShareLinks should be findable by access_code for the download page.

Best practices

  • Generate long, random access codes for share links
  • Add optional password protection for sensitive files
  • Set expiry dates on share links for time-limited access
  • Track download counts for usage monitoring
  • Allow file owners to revoke share links at any time
  • Use Privacy Rules to protect files from unauthorized API access
  • Set file type and size restrictions on the uploader

Still stuck?

Copy one of these prompts to get a personalized, step-by-step explanation.

ChatGPT Prompt

I am building a file sharing platform in Bubble.io. Users should upload files, generate shareable links with optional passwords and expiry dates, and track downloads. How do I structure the data types and build the share/download workflows?

Bubble Prompt

Build a file sharing platform. Create SharedFile and ShareLink data types. Add file upload with share link generation including password protection and expiry options. Build a download page that validates access and tracks downloads.

Frequently asked questions

What is the maximum file size?

Bubble allows uploads up to 50MB on paid plans. For larger files, integrate with AWS S3 or Google Cloud Storage via the API Connector.

Can I share files with non-users?

Yes. The download page uses the access_code URL parameter and does not require login. Anyone with the link can access the file (subject to password/expiry restrictions).

How do I add folder organization?

Create a Folder data type with name, owner, and parent_folder fields. Link SharedFiles to folders and build a folder navigation UI.

Can RapidDev help build an enterprise file sharing platform?

Yes. RapidDev specializes in Bubble development and can build enterprise file sharing with team permissions, audit trails, version control, and external storage integration.

Are uploaded files encrypted?

Bubble stores files on AWS with encryption at rest (AES-256). Files in transit use HTTPS. For additional security, consider encrypting files before upload.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Need help with your project?

Our experts have built 600+ apps and can accelerate your development. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.