File storage
Photos, profile pictures, attachments: when the people using your app upload something, it has to be kept somewhere. File storage is that place. It comes with Berrybell Cloud, it's private to your project, and it's used by your app rather than by you. The Studio shows that it exists, but you can't open or manage the files from there.
Getting storage
There is no separate switch. Turn on Berrybell Cloud and storage is set up alongside the database. You can do that in either of two places:
- in Cloud → Database, with Enable Berrybell Cloud, or
- on the card the AI shows in the chat when a request needs saved data, with the same button.
See Your project database. The requirements are the same as for the database: an active plan with hosting credits, and the Editor role in the workspace (see Team & roles).
The database and storage are set up independently, so a problem with one doesn't take the other down. Projects that turned Cloud on before storage existed get storage automatically, with nothing to do.
The Storage panel
Open your project settings and go to Cloud → Storage. What you see depends on where things stand:
- Storage comes with Berrybell Cloud — Cloud is off for this project. Open Database settings takes you to the switch.
- Setting up your storage… — "This usually takes a few seconds." The panel keeps checking on its own.
- Ready, followed by the storage's name (its bucket name) — storage exists and your app can use it from its next publish (see below). The name identifies your storage if you contact support. It isn't a key: nothing can be read or written with the name alone.
- Storage could not be set up — shows the reason, says "Your app cannot save files until this is sorted out. Your database is not affected.", and offers Retry.
- Storage is switched off — Berrybell Cloud was turned off and your files were kept. See When files are deleted.
Below Ready, a box headed Files land here from your app says that the files your app saves are kept here, private to the project, and that you can't browse them from the Studio yet.
Anyone in the workspace can view the panel. Storage has no settings of its own: there's no enable button, because storage follows Berrybell Cloud, and there are no upload, download or delete controls.
How your app uses it
Your app reaches its storage through a built-in connection (a binding) named
STORAGE. No access key, secret or URL is involved. Nothing is added to your code
or to Variables & secrets, so there's no
credential that could leak.
The binding is attached when you publish, starting with the first publish after the panel shows Ready. If your app was published before then, publish again. The preview's deployed copy gets it the same way, from the first copy built after storage is ready.
| Where your app is running | Storage connected |
|---|---|
| Published app | Its environment's storage: production's, unless you publish to another environment |
| Built lane of the preview pane | The storage of the environment selected in the top bar |
| Live lane (the dev server) | None |
| Pre-rendered static build | None |
So test uploads on the built lane or on the published app, not on the live lane (see The built lane and the live lane). Uploads made on the built lane are stored for real. Each environment has its own storage explains whose storage they go to.
There is no public address for stored files. A stored file has no URL of its own. Your app serves it through one of its own routes, which reads the file from storage and returns it. Those requests count as App requests and App CPU time, like any other request to your app.
The AI can't see your files. The AI's Berrybell Cloud connection covers the database only, so it can't list or read what's stored. It writes the code that uses storage, and your app does the reading and writing.
STORAGE bindingA publish can be marked failed with a message that begins "deploy is live but 1 required binding(s) never reached the Worker: STORAGE". When that happens the new version is live anyway, just without storage, so saving and opening files won't work. Publish again.
Asking for uploads
Tell the AI what to store, and say that it goes in the project's storage:
Let users upload a profile photo and keep it in the project's file storage (the
STORAGEbinding).
The AI isn't told about your storage by default. Naming it tells the AI where the files belong; otherwise it may keep them somewhere else, such as in the database.
Each environment has its own storage
On a project with environments (a Business plan feature), each environment you create gets its own storage, empty to begin with, as long as production has storage. On such a project the panel shows the storage of the environment selected in the top bar, and once that storage is ready it says:
Each environment has its own storage, which starts empty. The files here belong to this environment only.
- Files are never copied between environments, whether you're creating an environment or publishing to one.
- Reset gives an environment a fresh copy of production's database but leaves its files alone.
- If you delete an environment and create a new one with the same name, the new one gets new, empty storage. The old files aren't carried over; they're scheduled for deletion (see below).
- While a new environment's storage is being set up, the panel shows Setting up storage for this environment….
- If production has no storage, an environment shows Storage is off for this project instead.
The built lane of the preview uses the storage of the environment selected in the top bar (see The selected environment). On a project with only production, that's production's storage, the same place your real users' uploads go. A file you upload while testing in the preview then sits beside your users' files and stays there until your app deletes it. On a project with environments, select one other than production before testing uploads if you want test files kept apart.
When files are deleted
Berrybell never deletes stored files straight away. When an environment or a project is deleted, its files are scheduled for deletion instead: a created environment's files after a grace period, 7 days by default, and production's files when Berrybell removes them (see below). You can't cancel that from the Studio. If you deleted something by mistake, contact support as soon as you can, and for an environment before the grace period ends. Files keep counting toward App file storage until they are actually removed.
Deleting an environment. Its files are scheduled for deletion. From that moment no preview or publish connects to them again. Anything already published at the environment's address keeps serving its last build (see Deleting), and that build still has its storage connected.
Deleting a project. Every environment's files are scheduled for deletion. Created environments' files follow the grace period above. Production's files are held until Berrybell removes them, because deleting a project doesn't take its published site down, and they keep counting toward App file storage until then.
Turning Berrybell Cloud off. There's no control for this in the Studio; only support can do it. The database is deleted (see Your project database), but production's files are kept: the panel shows Storage is switched off and "Nothing has been deleted." Your app's next publish goes out without storage connected, so from then on it can't save or open those files. The kept files can still count toward App file storage; if you want them removed, contact support. Turning Cloud back on sets up a database again but doesn't reconnect the files; contact support to have storage switched back on. Every created environment is deleted along with Cloud, and its files are scheduled for deletion.
Costs
Stored files are metered as App file storage, in GB·mo, and drawn from your hosting budget at cost plus a margin, like the rest of Berrybell Cloud. The line appears on the Usage this billing cycle card of the Cloud overview in project settings, and on the workspace Plans & usage page, in the Usage tab under Cloud usage (this cycle).
- You pay for what you keep. Storage is billed on the largest amount stored in each hourly window.
- It costs money whether or not anyone visits. Stored files keep costing while nobody uses your app, and while your app is paused because the hosting budget ran out.
- Reads and writes aren't charged separately. The requests your app handles to save or serve a file count as App requests and App CPU time, like any other request.
On a project with environments, the Storage panel also shows Usage this billing cycle for the selected environment's storage. Peak size and Peak count (the number of files) come from the most recent hourly collection, so they show roughly how much is stored now, not the highest this cycle. Charged is the total for the cycle so far. The block is captioned "Collected hourly. Charges are for this billing cycle so far." Before the first hourly collection it reads "Nothing collected yet. Usage shows up after the next hourly collection."
See Usage & costs for how the hosting budget works.
Limitations
- No file browser. You can't see stored files in the Studio.
- No upload, download, export or delete controls. Only your app can add or remove files.
- No public URL. Your app has to serve stored files through its own routes.
- No choice of storage location. Berrybell decides where your files are kept.
- The AI can't read your files. It can't list or open what's stored.
- Not on the live lane. The dev server and pre-rendered static builds have no storage connected.
- No self-service undo for deletions. You can't cancel a scheduled deletion yourself; contact support within the grace period.
- No automatic reconnect. Storage switched off along with Berrybell Cloud isn't reconnected when Cloud is turned back on.