Letting visitors upload large files: size and time limits on BrewInTH

How large a file your site's visitors can upload on BrewInTH: 20 MB or 400 MB by package, the time limits, framework limits and where to keep the files.
Your site lets customers attach a payment slip, lets technicians send photos from the job, or lets students hand in a video. On your own computer every upload works. Once the site is online, some files never make it: the page spins for a long time, or shows something odd like request_body_too_large, and you cannot tell whether the code or the host is to blame.
This article explains how large a file BrewInTH accepts from your site's visitors, and for how long, on each package; what a visitor sees past the limit; where the frameworks AIs like to use set lower limits of their own; where the files should be kept; and it gives you a ready-made message for your AI so the app really can take large files.
In short
📦 One request may carry up to 20 MB on the Free package and 400 MB on paid packages, counting every file and field of the form.
⏱️ A file has about 45 minutes to arrive, but once it has, the app must start answering within 2 minutes (Free) or 10 minutes (paid).
🚫 A file that is too large gets a 413 answer and never reaches the app.
🧩 PHP already gets limits that match your package; Node.js, Next.js and Python have much lower limits of their own that your AI has to set in code.
💾 Move every received file to /bw-data straight away: /tmp is emptied each time the app starts again.
The four stops of an uploaded file
When a visitor presses send, the file does not go straight into your app. It passes four stops, and each one can turn it away.
- The visitor's browser. The best place to say a file is too large, because nobody has spent time sending it yet.
- BrewInTH's entrance. It checks the size against your package and answers at once when it is too large; the file never reaches the app.
- Your app. The framework or library that receives the file has its own limit, often far below BrewInTH's.
- Where the file is kept. Files usually land in /tmp first, and the app then moves them to persistent storage, /bw-data.

When a visitor says an upload failed, look at the project's Logs tab first. A framework error about the request size means the app stopped it. No trace of the request at all suggests the file was cut off at the entrance.
BrewInTH's limits: size and time
These limits apply to every technology, whatever language your app is written in.
- Size per request. Up to 20 MB on Free; up to 400 MB on every paid package, from Starter at ฿99 a month. The number covers the whole request, so a form with three attachments must stay under it in total.
- Time for the file to arrive. About 45 minutes per request. A 400 MB file over a 5 Mbps upload takes roughly 11 minutes, so there is plenty of room.
- Time to answer. Once the file has fully arrived, a request whose app sends nothing back for 2 minutes (Free) or 10 minutes (paid) is cut off, and the visitor sees "A temporary system problem".
- /tmp space. The app's place for temporary files: 64 MB on Free, 2 GB on Starter, Seed and Maker, 10 GB on Growth and 25 GB on Pro.

What a visitor sees past the limit
A file larger than the package allows is refused at the entrance with status 413 and this answer. The app never sees the file.
{"error":"request_body_too_large"}
If your page sends the file with fetch, your code decides what the visitor sees. With a plain HTML form, the visitor gets this raw text or a "connection failed" page, depending on the browser, neither of which tells them what to do next.
The best fix is to have the page check the file size before sending. The browser knows the size the moment the visitor picks the file, so it can say "This file is 35 MB; the site accepts up to 20 MB" right away, instead of after a long upload that was never going to work.
An app that receives the whole file but then works on it for longer than the answer time leaves the visitor looking at "A temporary system problem", even though the file may already be saved. The cure is to answer first and do the work later, covered further down.
The app's own limits, often lower than BrewInTH's
PHP and Laravel
BrewInTH already sets upload_max_filesize and post_max_size to match your package: 20M on Free and 400M on paid packages, with up to 50 files a request. Most PHP sites need no change.
The platform manages these values; a php_value line in .htaccess or ini_set() in your code cannot change them. What you still need to check is Laravel's file validation, where max: counts kilobytes: max:102400 means 100 MB.
Node.js and Express
express.json() and express.urlencoded() accept only 100 KB by default and answer 413 themselves beyond that. Take files through a library such as multer with an explicit limits.fileSize, and do not hold whole files in memory: the Free package has 256 MB of RAM and Starter 512 MB, so a few large uploads at once can bring the app down. Write them to disk instead.
Next.js
Server Actions accept 1 MB by default. An upload form built on a Server Action needs serverActions.bodySizeLimit in next.config, or your AI can switch it to a route handler that writes the file to disk as it arrives.
Python
Django keeps uploads larger than 2.5 MB in /tmp by itself and limits the non-file part of a request to 2.5 MB with DATA_UPLOAD_MAX_MEMORY_SIZE. Flask uses MAX_CONTENT_LENGTH as its ceiling.
The rule is the same in every language: set the app's limit at or just below the package's, so visitors get a message your app wrote rather than the platform's.
Where received files should live
An app on BrewInTH can write in only two places, /tmp and the persistent storage at /bw-data. The app's code folder is read-only.
- /tmp is a waiting room. PHP, and Django for files over 2.5 MB, write uploads there before your code sees them. /tmp is emptied every time the app starts again (a new release, a restart, waking from sleep), and its size follows the package. Writing past it makes the platform stop the app and start it again. An app on Starter receiving about five 400 MB files at once is already close to full, so move or delete files in /tmp as soon as you are done with them.
- /bw-data is where files stay. Files there survive releases and restarts. Keep the files there and store only their names in the database. How to turn it on is in keep user uploads safe with persistent storage; for a Laravel site, put
storage/on the volume as described in this article.
Files on /bw-data count toward your package's storage by actual use, and the space grows by itself as it fills; see storage counted by use, and persistent storage that grows by itself. A site that takes files from customers should keep a backup of them too: see backing up and restoring the files in /bw-data.
Heavy work after the upload: answer first, work later
Making several sizes of a photo, converting a video or reading an Excel sheet with tens of thousands of rows can take longer than the answer time. Have the app save the file and tell the visitor "File received, processing" at once, then do the heavy part in the background, or let a scheduled job pick up waiting files every few minutes. Setting one up is explained in running cron on Thai time on BrewInTH.
Files larger than 400 MB
There is currently no setting in the console for requests above 400 MB. If your site really has to take files that big, two approaches are common:
- Send the file in pieces. The page cuts the file into chunks of a few tens of MB, sends them one by one, and the app joins them into one file on /bw-data. A dropped connection only means resending the piece that failed.
- Send it straight to an outside storage service. The app issues a short-lived upload link from a service such as S3 or Cloudflare R2, the browser sends the file there, and the app keeps only its address.
Both need extra code from your AI; tell it from the start that the limit per request is 400 MB.
Let your AI prepare the app for large uploads

Send this to Claude Code, Cursor or whichever AI has your project folder open, with the values in brackets changed to fit your site:
This app is hosted on BrewInTH on the [Free / Starter or higher] package.
Visitors need to upload [kind of file], at most [N] MB per file
(BrewInTH's limit per request: 20 MB on Free, 400 MB on paid packages).
Please prepare the app:
1. Check the file size and type in the browser before sending. If it is too
large, tell the visitor at once in plain language, and show the same
message if the server answers 413.
2. Set the limit of the framework and upload library to [N] MB, and write
the file to disk as it arrives instead of holding it in memory.
3. Move the file into a folder on /bw-data and store only its name in the
database. If the project has no persistent storage yet, tell me how to
turn it on.
4. Delete the temporary file in /tmp as soon as it has been moved.
5. If a file takes long to process, tell the visitor it was received first
and do the work in the background.
6. Give uploaded files names of your own, accept only the extensions needed,
and make sure an uploaded file can never be run as code.
Point 6 matters as much as size: files from strangers are untrusted data. There is more on safety in is a website built with AI safe?
FAQ
Does this limit apply to the ZIP I use to put my site online?
No. This article is about files your site's visitors send. The files you use to publish your site have limits of their own: the Upload & go live page takes a ZIP of up to 256 MB and a .tar.gz backup of up to 1 GB.
Do uploads count toward bandwidth?
BrewInTH's bandwidth counts data sent from your site to visitors, so files that visitors send in are not counted. Every time someone views or downloads such a file, though, its size is. A site where people often view photos or clips should shrink them before showing them.
When does the limit change after I upgrade?
You do not set anything. The entrance follows the new package almost at once; PHP's values take effect after the app starts again, which the platform does by itself within a few minutes of the package change.
Can a static site accept uploads?
No. A static site is only HTML, CSS and JavaScript files, with no server-side program to receive a file. You need an app, for example in Node.js, PHP or Python, to receive files and write them to /bw-data.
Is the Free package's 20 MB enough?
For phone photos, payment slips and ordinary PDF documents, yes. Not for videos or large design files. And since /tmp on Free holds only 64 MB, the app should move each file out of /tmp as soon as it has arrived.
Summary
BrewInTH accepts requests of up to 20 MB on the Free package and 400 MB on paid packages; a file has about 45 minutes to arrive, and the app must start answering within 2 or 10 minutes of receiving it. PHP already gets limits that match your package; other frameworks need their own set. Check the size in the browser before sending, keep files on /bw-data, move heavy work to the background, and your visitors can send their files without ever meeting a message they cannot read.
Start your first project for free →
