Instructions
Overview
This plugin adds workflow actions you can use to:
1. Get the size of an uploaded file from its URL
2. Convert any value between Bytes, MBs, and GBs
3. Return a list of valid “Convert To” units based on the chosen “Convert From” unit (so the same unit is excluded)
1) Action: Get File Size
Purpose: Returns the file size as bytes + MB + GB (MB/GB rounded to 2 decimals).
Input
• file_url (text): Pass the uploaded file URL.
✅ Use: FileUploader's value:url
(If the URL starts with //, the action auto-fixes it to https://)
Outputs
• size_bytes (number)
• size_mb (number) — rounded to 2 decimals
• size_gb (number) — rounded to 2 decimals
• debug (text)
Typical usage
• Create “Document” thing → store file
• Run Get File Size → store size fields
• Update Current User’s storage_used_gb += size_gb
• Block uploads if user would exceed storage_limit_gb
2) Action: Convert Size
Purpose: Convert a numeric value from one unit to another (Bytes/MBs/GBs). Rounded to 2 decimals by default.
Inputs
• value (number)
• from_unit (text): Bytes / MBs / GBs
• to_unit (text): Bytes / MBs / GBs
• decimals (number, optional): default 2
Outputs
• result (number)
• result_text (text) (example: 0.49 GB)
• debug (text)
3) Action: Allowed “To Units”
Purpose: For UI dropdown logic: returns allowed target units excluding the selected “From” unit.
Input
• from_unit (text)
Output
• allowed_to_units (list of texts)
UI tip
Use allowed_to_units as the choices source for your “Convert To” dropdown to automatically exclude the selected “Convert From” unit.
Notes
• Uses 1024-based conversion (1 MB = 1024² bytes, 1 GB = 1024³ bytes).
• For accurate quota enforcement, store sizes in a single unit consistently (recommended: GB or bytes).
Demo app (editor):
https://bubble.io/page?id=codify-labs&tab=Design&name=user_storage_limit&type=page&elements=bTHRL