Skip to main content

File Storage

Instroc Cloud gives every app its own file storage for images, documents, and anything else your app needs to keep. You can upload files yourself from the Storage panel, or let Roc build upload features straight into your app so your users can add files too. This page explains how buckets work, the limits to know about, and how files flow through an app.

Public and private buckets

Every file lives in one of two buckets, and the bucket decides who can see it.

  • Public: anyone with the link can view the file. No sign-in is required. This is the right place for images that appear on your pages, downloadable brochures, product photos, and anything else meant for every visitor.
  • Private: only signed-in users of your app can view the file. Visitors without an account, or with the link but no session, cannot open it. Use this for user uploads, documents tied to an account, and anything that should not be reachable by guessing a URL.

Choosing correctly matters more than it might seem. A file's bucket is its access control, so a contract PDF belongs in private even if the link "looks" unguessable, while your homepage hero image belongs in public so it loads for everyone.

Each individual file can be up to 50 MB. That comfortably covers photos, PDFs, and audio clips; for very large video you would typically embed from a video host instead.

Uploading from the Storage panel

The Storage panel lives in the editor under Instroc Cloud > Storage. From there you can upload files directly, pick the bucket they go into, and manage what is already stored. It is the quickest way to get assets like logos, product images, or downloadable files into your app without building any upload UI.

The panel shows your files in a table, and you can preview a file directly in the panel to confirm you uploaded the right thing. This is also where you go to check what your users have uploaded once your app is live.

Letting Roc wire uploads into your app

For anything beyond your own assets, ask Roc to build the upload flow. A prompt like "let signed-in users upload a profile photo" or "add a document upload to the application form, private" is enough; Roc adds the file picker, the upload handling, and the display logic, and picks the appropriate bucket for the use case.

Under the hood, apps use the SDK's storage hooks. useFileUpload handles the upload itself (you pass the file and the bucket), useFileList lists stored files, useFileDelete removes one, and useFileUrl resolves a file id to its URL for display. Each upload returns a stored-file record with its id, URL, filename, type, and size, which your app can save alongside its other data (for example, storing an image's file reference on a product record).

const { upload, uploading, error } = useFileUpload();

async function onFileChosen(file: File) {
const stored = await upload(file, { bucket: "private" });
// stored.id and stored.url are ready to save or display
}

You rarely need to write this yourself; it is what Roc writes when you ask for uploads. The full hook signatures, options, and the HTTP endpoints behind them are documented in the storage API reference.

caution

Keep the bucket choice in mind when you prompt. If users upload anything personal, say "private" in your request so the files are only visible to signed-in users. You can always tell Roc to move a feature from one bucket to the other later.

How storage is billed

File storage is part of Instroc Cloud and is metered like the rest of your backend, billed at a low rate per GB per month from your Cloud allowance and balance rather than from AI credits. Every plan includes a Cloud allowance that covers light usage. See Cloud billing for how allowances and balances work, and the current rates at instroc.com/cloud.

For the broader picture of what Instroc Cloud provides (database, user accounts, functions, and storage together), start with the backend overview. For working with stored files in code, see the storage API reference.