Receiving Files From Third Parties Without Sharing a Folder
Table of Contents
A client promises a folder of scanned contracts and sends a link that opens the folder read-only, so your team can look at the files but not add the signed copies. Next week the same material arrives three times with names ending in (1), (2) and final-final, and one of them is a 0-byte file that looks perfectly normal in the listing. None of these failures are network problems. They come from confusing a download capability with an upload capability, and from accepting whatever bytes arrive without inspecting them.
A file request is a write-only endpoint
The two links people habitually exchange look similar and behave in opposite ways. A download link is a read capability: an HTTP GET carrying a token that maps to an object, and anyone holding it can fetch the bytes. A file request is a write capability: the URL resolves to a form, the form issues a POST with multipart/form-data, and the server answers with a created-object identifier. There is no route back — the request key does not authorise listing or retrieval.
Sharing a folder with edit rights grants read, write and delete simultaneously, so a client who mistypes a folder name can move or remove another client's submission, and your only evidence of what arrived is a modification timestamp. A file request reduces the permission set to creation, so a careless upload cannot overwrite an earlier one.
A request key is not a secret worth reusing. Anyone who obtains the URL can upload, so rotate it per engagement and close it when the engagement ends rather than leaving one permanent intake address in a signature block.
| Property | Public download link | Shared folder with edit rights | File request |
|---|---|---|---|
| Sender can read files | Yes | Yes | No |
| Sender can add files | No | Yes | Yes |
| Sender can delete files | No | Yes | No |
| Sender sees a listing | Yes | Yes | No |
| Revocation scope | One object or folder | Whole permission grant | Intake only |
| Typical failure mode | Link forwarded beyond intent | Accidental overwrite | Duplicate or misnamed uploads |
Three ceilings, not one
Size complaints almost always name the wrong limit. Three independent numbers apply, and a file must clear all three.
The first is the per-file ceiling of the receiving endpoint, often set well below the storage plan. The second is the request body limit of the web server: PHP ships upload_max_filesize = 2M and post_max_size = 8M in php.ini-production, Nginx defaults client_max_body_size to 1 MB, and both produce an HTTP 413 or a silent truncation long before the provider's quota matters. The third is the account quota, which is a billing or plan question and entirely unrelated to the other two.
Chunked uploads are what make the first ceiling survivable, because the client sends numbered blocks and the server assembles them, so the effective object size is bounded by disk rather than by a single request. When the receiving side has no chunking, the practical fix is to split before sending: 7z a -v1500m contracts.7z ./scans produces volumes that clear almost any body limit.
Duplicates and version drift
The same drawing will arrive as plano.pdf, plano (1).pdf, plano_v2.pdf and plano definitivo.pdf, and at least two of those four are byte-identical. Filenames are a numbering system invented by whoever was at the keyboard, so they cannot carry the deduplication load.
Hash on receipt instead. Compute SHA-256 for every arriving file, store it in an intake log alongside the received timestamp, the byte count and the declared sender, and compare each new digest against the log before the file is moved anywhere. A repeat is a repeat whatever it is called, and a file that claims to be revision 2 but hashes the same as revision 1 is not a new revision at all.
Versioning belongs on your side, not the sender's. Keep the landing area append-only, copy verified files into a dated archive path such as archive/2026/11/, and rename deterministically — 20261112_client_contract_rev02.pdf survives being moved between systems, sorted by a shell and read by a colleague who was not on the call.
Validating names and real types
Two things about an arriving file are attacker-controlled or simply wrong: its name and its claimed type.
Names break in predictable places. macOS hands over decomposed Unicode (NFD) while Windows stores composed (NFC), so café.pdf and cafe´.pdf are different strings that render identically and collide on extraction. Windows refuses CON, PRN, AUX, NUL and names ending in a dot or space. A name containing / or \ can write outside the target directory if the receiving code naively joins paths. Long nested trees hit the 260-character path ceiling on Windows.
Types need inspecting rather than reading. The extension is a label the sender typed; the first bytes are the file. file --mime-type -b incoming.bin on Linux or macOS, or Format-Hex -Path incoming.bin -Count 8 in PowerShell, returns the real container family. PDF opens with 25 50 44 46, ZIP-based formats with 50 4B 03 04, and a double extension such as invoice.pdf.exe changes nothing about the header.
A workable intake procedure:
- Copy the landing area to a working directory and record sizes and timestamps before touching anything.
- Reject zero-byte files and any name failing an ASCII-plus-known-Unicode allowlist.
- Read the first eight bytes and compare against the expected signature for the declared extension.
- Compute SHA-256 per file and append the result to the intake log.
- Rename to the house scheme, then move the file into the dated archive path.
Proving the copy is intact
A zip that lost its final block still opens in some tools and reports "Unexpected end of archive" in others; a truncated PDF renders the first pages and fails at the end. Structural checks catch blatant damage, and the CRC32 stored inside a ZIP catches single-member corruption, but CRC32 is a transmission check by design and no defence against a deliberate edit.
The only dependable signal is a digest computed on both ends with the same algorithm. If the sender can produce one, compare it. If not, compute SHA-256 on receipt and keep it as the baseline — it will not prove where the file came from, but it will prove whether the archived copy is still the one you accepted six months later. The checksum verifier runs SHA-256, SHA-1 and MD5 in the browser when the person at the other end has no terminal, and archive repair covers what to do when the digest disagrees and the container is a ZIP or RAR.
Intake is finished when a name is deterministic, a type is confirmed and a digest is stored — not when the upload bar turns green.
Troubleshooting Common Issues
| Error / Issue | Technical Cause | Step-by-Step Fix |
|---|---|---|
| HTTP 413 Request Entity Too Large | The request body passes the server's post_max_size or the proxy's client_max_body_size, which are separate from your storage quota. | Split the file into volumes below the ceiling, or raise both limits in the server configuration and restart it. |
| The uploaded file exceeds the upload_max_filesize directive in php.ini | PHP rejected the object before the application saw it, so no partial file exists and nothing was logged by the app. | Set upload_max_filesize and post_max_size above the largest expected file, then confirm with phpinfo that the change loaded. |
| Unexpected end of archive | The upload stopped before the central directory was written, usually a browser tab that closed mid-transfer. | Compare the received size against the sender's report and request the file again rather than attempting a repair on a truncated stream. |
| The file name you specified is not valid or too long | The submitted name carries a reserved device name, a path separator or a tree deeper than the 260-character Windows ceiling. | Rename on receipt to a scheme you control, using ASCII letters, digits, hyphens and a single extension. |
Frequently Asked Questions
Why not just share a folder with edit permission and let the client drop files in?
Because edit permission is read, write and delete at once. One client can delete or overwrite another client's submission, and you lose the ability to prove what arrived and when. A file request grants creation only, so the damage a careless or hostile uploader can do is bounded.
Does a file request need the sender to have an account?
Usually not. The provider issues a public URL where the sender selects or drags files and submits them, and the upload is attributed to whatever name or email field the form collects. Treat that attribution as a claim, not as identification.
How do I stop the same document arriving five times?
Hash every received file with SHA-256 and compare against the intake log before moving it. Names lie and version suffixes multiply; identical bytes always produce an identical digest. Keep the duplicates for a week, then delete them once the client confirms the final revision.
Is the file extension enough to know what the file is?
No. Extensions are user-editable text. Read the first bytes instead: PDF starts with 25 50 44 46, ZIP-based Office documents start with 50 4B 03 04, and a renamed executable keeps its original header no matter what the name says.
Related Technical Guides
Cloud Account Quotas and 2FA Across Several Providers
How quota meters really count space, which free upgrades last, and how TOTP, recovery codes and inactivity clauses can cost you an account.
Diagnosing Failed Downloads: Codes, Truncation, Corruption
Read 403, 404, 410, 429 and 503 correctly, tell a truncated file from a corrupt one, and resume with HTTP Range instead of starting over.
Large Uploads That Survive Interruptions: Chunks, Limits, Hashes
How chunked uploads work, why closing the tab loses the progress, when compression helps, and how to prove the file landed intact.
Shared Links Are Credentials: Tokens, Expiry and Revocation
Why a share URL works like a password: token entropy, expiry, revocation, password gates and how to audit who holds a copy.