Upload links for people without an account (getting a full-quality video from a friend)
uploadsvideoobject-storagepresigned-urlsmultipartcapability-urlsharingux
Text messages, chat apps and email all re-compress or cap video, so "just send it to me" loses the resolution. For a sender who is not technical, the lowest-friction fix is a link they tap that opens a page with one button. This describes that feature as built on a personal video site (a "drop link"), and what its first real use taught.
Without building anything
- iPhone: share from Photos as an iCloud Link; that keeps the original.
- Android: a Google Photos link keeps full resolution only if backup quality is set to Original; otherwise a Drive link.
- Either: a browser transfer service that needs no account.
The built version is worth it when the same person will send more than once, or when even "make a link" is too many steps.
The shape of the feature
- The owner makes a link in the admin: a name for who it is for, and an expiry (seven days by default). The link carries a random token, and the token is the only credential ("Anyone with the link" share links (capability URLs)).
- The sender's page has one large "Choose video" button. The upload starts on pick, shows a progress bar, retries by itself, keeps the screen awake and ends on a plain "Sent!" screen. No account, no app, no form.
- The file goes from the browser straight to object storage as a multipart upload over pre-signed URLs in 16 MB slices (Linode (Akamai) Object Storage). A multi-gigabyte file never passes through a small web server.
- The server builds every storage key itself, under a prefix for that token. The page can start, finish or abort an upload for its token and nothing else. Limits are per link (files per link, bytes per file).
- Nothing received is published. It lands in a holding list showing size, resolution and length, with a download button (a signed GET with an attachment disposition). Showing the resolution is how the owner checks that the original, not a shrunken copy, arrived.
- The owner gets an email when a file lands. Send it from a domain that has SPF and DKIM set up, even if that is not the site's own domain, or it goes to spam.
The first real use failed
A friend on Chrome for Android picked a 181 MB video. The upload was created, then every slice failed instantly and the page showed "Connection hiccup, trying again" at 0% until it gave up. The cause was never identified, because the page had not recorded one. The two candidates that fail instantly:
- The network cannot reach the storage host. Some Wi-Fi networks and filters block object storage domains while the site itself loads fine.
- The browser cannot read the picked file. A video that lives in cloud backup instead of on the phone can be listed by the picker and then fail on read.
What was added, and what any such page should have from the start:
- A relay route. After two direct failures, slices are posted to the site's own server, which forwards each to storage with the same multipart upload. Slower, and the server holds one slice in memory, but it works wherever the site itself is reachable. The relay endpoint needs a raised request body limit for that one path only (an nginx
location =block withclient_max_body_size), leaving the rest of the site at its small default (nginx in front of Apache (TLS proxy on :8008)). - Read before sending. Read each slice into memory first, so a file that cannot be read is told apart from a network failure and gets its own message: download the video to the phone, then choose it again.
- A failure log. The page reports why a slice failed to the server (time, link, browser, reason; a size-capped file). Without it, a remote failure on someone else's phone is unknowable. Read that log first next time.
A generic "trying again" loop is the wrong default for a non-technical sender: they see a stuck bar and give up, and the owner learns nothing.
Testing the fallback
Headless Chrome can make one host unreachable with --host-resolver-rules="MAP <storage-host> 0.0.0.0", which forces the relay path on a machine where the direct path works. Compare the sha256 of what arrives with the source file on both routes (Headless Chrome testing gotchas).
Sharing what was received
A second token per file gives a public page with the site's normal player and a "Download original" button. The same file always gets the same address; turning sharing off or deleting the file ends it; the upload link's expiry does not.
- The page plays the original file with no transcode. A phone's HEVC video does not play in every browser, so the page needs a clear "can't play this format here, download it" state (Encoding phone clips for the web (HEVC remux, H.264 fallback)).
- Without a poster image, a pasted link unfurls as text only (Open Graph link previews (SPAs, private posts, private-storage media)).
Open questions
- iPhone may hand a web page a re-encoded copy of a Photos video. A file input with
multipleis reported to pass the original through; this was not confirmed on a device. The fallback is "Save to Files" first, or an iCloud link. - Unfinished multipart uploads take up space until aborted; something has to sweep them or the owner has to delete them.
See also
- videos.jhampton.io (private video site architecture)
- Accepting and serving user uploads safely from a private bucket
- "Anyone with the link" share links (capability URLs)