File upload API and widget
Let people upload files to your app.
Add an uploader to your page or call one API from your server. Fileboy stores the file, scans it for viruses (up to 100 MB) and gives you an id to use everywhere.
What you get
- UploaderReact, Vue, script tag
- Large filesResumable parts
- Virus scanClamAV, up to 100 MB
- You getOne id
From a file picker to a file id in three steps
File uploads usually mean a form, a storage bucket, size limits, retries and something to check what arrives. Fileboy gives you those, with one key.
Add the uploader or call the API
Drop a component into your app, or send the file from your server. A public key in the page is enough to upload.
Fileboy stores and checks it
The file is stored and given an id, and files up to 100 MB are scanned for viruses. Images get a colour palette, and you can have webhooks sent as it lands.
Use the id
Store the id, then use it to serve the file, resize an image or manage it from your server.
Add it in a few lines
Use the uploader in the browser, or upload from your server with an HTTP call or a library. The public key is meant for web pages.
Not sure how to start? Follow the React upload guide or read the uploader docs.
import { FileboyProvider, MultiFileUploader } from "@cd2/fileboy-react"
function Gallery({ save }) {
return (
<FileboyProvider publicKey="YOUR_PUBLIC_KEY">
<MultiFileUploader resumable onFilesUploaded={files => save(files)} />
</FileboyProvider>
)
}What you get with every upload
An uploader for your app
Drag and drop, several files at once, paste a screenshot, take a photo on a phone, and a field to import from a link. It shows previews, checks file types and gives you the id. For React, Vue, Svelte, Next.js and a script tag.
Libraries for your server
Upload, read and manage files from Node.js, Ruby, Python and PHP, or call the HTTP API from anything else. An OpenAPI description is published for code generators.
Large and resumable uploads
Big files go in parts of 8 to 64 MiB. A failed part is retried on its own, several go at once, and an upload carries on after a crash or a reload. The libraries switch to parts for files of 50 MiB and up when you turn on resumable. One file can be up to 5 GB. Resumable uploads
Upload from a URL
Give the API a link and Fileboy fetches the file, so it never passes through your server. The link must be public: localhost and private addresses are refused. The file keeps its source link in its metadata.
Virus scanning
Fileboy scans what people upload with ClamAV a few seconds after each upload. Files up to 100 MB are scanned; larger ones are skipped, and the file says so. A file found to contain malware is blocked and you get a file.infected webhook. You can also hold downloads of new files until they are scanned. Virus scanning
Allowed origins
List the websites whose pages may upload with your public key, and other sites' pages are refused. It stops other websites using your key in the browser, not someone calling the API directly, and the docs say when you need more. Allowed origins
Your own storage on Max
On the Max plan, keep an app's files in your own S3-compatible bucket (Amazon S3, Cloudflare R2, DigitalOcean Spaces, Backblaze B2, MinIO and others). Uploads, transforms and links work as before, and files are still served through Fileboy. Bring your own storage
Webhooks
A signed request when a file is uploaded, updated, deleted or found infected, and for videos too, so you never have to poll. Failed deliveries are retried, and you can replay events from the delivery log. Webhooks
Folders, names and metadata
Upload straight into a folder, set a name, and attach your own key-value metadata to find the file again. Move a file between folders without changing its links.
Private files and signed uploads
Make files readable only with a signed URL or an expiring link, and sign uploads from your server when the public key is not enough. Signed URLs
A good fit for
- Avatars, attachments and documents users upload in your app
- Large files from phones and slow connections
- Images that you then resize and serve with a URL
- Teams that want files in their own bucket
Good to know
- Storage and the number of files are hard limits on each plan: an upload past one is refused and nothing is stored. See pricing.
- Your own bucket is on the Max plan.
- Allowed origins guard the public key in browsers. They do not stop direct calls to the API.
Guides for uploads
Worked examples with code you can paste.
A working uploader, a file ID to store, and a resized preview, without writing an upload endpoint.
Move files from a script or server into hosted storage, from a path, a buffer, a stream or a URL, without writing any storage code. Node.js examples, with the other languages in tabs.
Send big videos and archives in parts, retried part by part, and carry on after a crash or a reload instead of starting again.
Add uploads to your app free
Create an app, paste your public key into the uploader and your users can upload. The free plan needs no card.