The photo was fine. The label was not.
A manager photographs a contract, uploads it, and the system refuses it — because a browser guessed the file type from its name and guessed wrong. Why an upload should read the file rather than believe its label.
Somebody photographs an employment contract on their phone, sends it to themselves, saves it, and uploads it. The system refuses it. The photograph is perfectly good. Nothing is wrong with it at all.
What is wrong is a label nobody ever typed.
A browser is guessing
When you pick a file, the browser tells the website what kind of file it thinks it is. It works that out largely from the name — the bit after the dot. That is a guess, and it is wrong more often than you would expect, because a file's name and a file's contents part company constantly. A photo saved out of one app and renamed by another. A screenshot that went through a messaging app. An image somebody downloaded, renamed, and sent on.
So a file called contract.png can be, and often is, a JPEG.
Nobody notices until something downstream checks. Ours did: we passed the browser's guess along with the file, the reader compared the two, saw they disagreed, and refused the lot. The manager sees a rejection. The file is fine. The rejection is ours.
Read the file
Every image format starts with a few bytes that say what it is. A JPEG opens
FF D8 FF. A PNG opens with an eight-byte signature. A PDF starts
with the letters %PDF. These are in the file itself; they cannot be
changed by renaming it.
So the fix is not to be cleverer about names. It is to stop reading the name
at all. Uploads now look at the first bytes and use what they find. A JPEG
called .png uploads as a JPEG, silently, because from the person's
point of view nothing interesting happened — they uploaded a photo and it
worked.
The iPhone case, which deserves its own answer
One format genuinely cannot be read, and it is the one an iPhone produces by default: HEIC. Refusing it is correct. Refusing it with "that file type cannot be read" is not much help to somebody standing in a kitchen.
Named properly, it becomes a thirty-second fix: Settings → Camera → Formats → Most Compatible, and take the picture again. Or share the photo to Files, which saves a JPEG. A Word document gets the same treatment — export it to PDF first, which is the actual answer rather than a refusal.
The half of this that was on our side of the screen
The same upload had a second problem, and it is the more embarrassing one. The form checked the browser's label before sending anything. A photo the browser could not name at all — no label, which happens when you pick one out of Files — was refused on the spot, without ever reaching the part of the system that can read bytes and settle the question.
A gate in front of a better judge is worth removing. It now checks the size, which it can actually know, and lets the file through to be identified properly.
What to try on yours
Take a JPEG, rename it to .png, and upload it wherever your
system takes photos — dish pictures, staff documents, invoice scans. If it is
refused, the system is reading the name. That is not fatal on its own, but it
means somebody will eventually be told a perfectly good photograph is broken, and
they will believe it.