Dev.to WebDev 🛠 Dev 👁 0 📖 4 min read

Government upload limits are a mess, so I documented all 18 of them

A few months ago someone told me their permanent residence application had been returned because a scanned document was too big. They had compressed it to 4 MB, which is what the article they read said. The portal they w

A few months ago someone told me their permanent residence application had been returned because a scanned document was too big. They had compressed it to 4 MB, which is what the article they read said. The portal they were using allows 5 MB — and the file they actually needed to shrink was a different one.

That sent me down a hole. I went looking for a table of official upload limits and could not find one that was both correct and sourced. What I found instead was a dozen blog posts confidently quoting numbers that contradict each other, usually with no link to anything official and no date.

So I built the table. Eighteen limits, each one linked to the page that states it, each one dated. Here is what I learned building it.

A single "service" often has several different limits

This is the part that burns people, and almost nothing on the web mentions it.

Canada's immigration department (IRCC) does not have one upload limit. The secure account, permanent residence and citizenship streams cap each file at 4 MB. The IRCC Portal allows 5 MB. Same department, same applicant, different ceiling depending on which door you came in through. If you compress to 5 MB because that is the number you read, and you are in the secure account, your upload fails.

France's DossierFacile does the same thing in a different direction: 10 MB per file, but 50 MB per document, where a document can be several pages uploaded together. Whether you scan your payslips one by one or as a single block decides which limit applies to you.

Any table that lists one number per organisation is wrong for at least some of its readers. Mine has five rows just for IRCC.

The range is five orders of magnitude

Service Limit
ICAI exam photo (India) 50 KB
French state services upload 1 MB
IRCC secure account (Canada) 4 MB
SARS eFiling (South Africa) 5 MB
Legal Aid Agency CCMS (UK) 8 MB
Microsoft 365 / Exchange 10 MB
DossierFacile per file (France) 10 MB
Gmail 25 MB
SEI (Brazil) 50 MB
CRA document submission (Canada) 150 MB
Slack 1 GB

The 50 KB at the top is not a typo. Indian professional exam portals cap the candidate photo and signature at 50 KB each, and every exam season generates a wave of people trying to get a phone photo under that. A modern phone photo is 3 to 5 MB. You need roughly a 100× reduction, which no "compress my image" slider is going to give you without thinking about dimensions first.

Limits move, and nobody announces it

The French state upload fiche I used as a source is from 2018. It is still the most specific public document I could find, and it is almost certainly stale. I flagged it in the table rather than quietly presenting it as current, which is the whole reason the table has a checked date on it: 2026-10-17 at the time of writing.

That date is the most useful column. A number without a date is a rumour.

Why the compression has to happen client-side

Here is the part that bothers me about how this problem is usually solved.

The documents people need to shrink to meet these limits are, overwhelmingly: passports, bank statements, payslips, medical forms, tax filings, proof of funds. The standard advice is "use a free online PDF compressor," which means uploading exactly those documents to a server belonging to a company you have never heard of, under a privacy policy you did not read, in order to satisfy a government portal's file size rule.

That is a strange trade to make, and it is entirely avoidable. Everything needed to compress, merge, split, convert and OCR a PDF runs fine in a browser now:

  • pdf-lib for structural work — merge, split, rotate, page numbering, metadata
  • PDF.js for rendering pages to canvas, which is what image-based compression comes down to
  • Tesseract compiled to WebAssembly for OCR, which is the one I expected to be unusable in a browser and which turned out to be fine
  • Canvas + toBlob with a quality parameter for the actual size reduction

The performance is acceptable. A 40-page scanned PDF compresses in a few seconds on a mid-range laptop, which is slower than a server would be, and nobody cares, because the alternative was uploading their passport.

The architectural consequence is the interesting bit: there is no upload endpoint in the application at all. Not a locked-down one, not one that deletes files after an hour — none. That is a claim you can verify from the network tab rather than from a privacy policy, which is the only kind of privacy claim worth making.

The table

It lives here, with the official source linked on every row and the date each one was last checked:

Official upload size limits for government portals and services

The tools that go with it are at pdfroll.com — free, no account, and everything runs locally.

If you know of a limit I am missing, or one that has moved since I checked it, tell me in the comments and I will add it with the source. That is the only way a table like this stays true.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.