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
Create the file sharing data types
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.
Build the upload and share interface
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.
Create the download page
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.
Add file management for owners
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
1FILE SHARING PLATFORM — WORKFLOW SUMMARY2==========================================34DATA TYPES:5 SharedFile: owner, file, filename, description, file_size, upload_date6 ShareLink: shared_file, access_code, password, expiry_date, is_active, download_count, max_downloads78SHARE URL FORMAT:9 https://yourapp.com/download?code=[access_code]1011WORKFLOW 1: Upload file12 Action: Create SharedFile (owner=Current User, file=Uploader's value)1314WORKFLOW 2: Generate share link15 Action 1: Create ShareLink16 access_code = generated unique string17 password = Input Password's value (if set)18 expiry_date = Date Picker's value (if set)19 is_active = yes20 Action 2: Display the share URL2122WORKFLOW 3: Download file23 Page: download?code=[access_code]24 Check 1: ShareLink exists and is_active = yes25 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 URL29 Action 2: Increment download_count30 Action 3: If max_downloads reached → is_active = no3132WORKFLOW 4: Revoke access33 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.
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?
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.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation