File Hosting & Sharing

Download Link

Definition

A download link is a URL that ends with a file arriving in somebody's Downloads folder. Whether that happens is decided by the response, not by the extension: one PDF served with a particular header opens in the browser's built-in reader, and the identical PDF served with a different header is written straight to disk. The header in question is Content-Disposition, and the saving behaviour is its attachment value. Browsers also honour a download attribute on an anchor tag, though only when the URL sits on the same origin as the page containing it. A download link and a direct link are frequently the same address wearing a different header — what changes is the instruction attached, never the bytes.

Why It Matters

Getting this wrong wastes people's time in both directions. A 40 MB video that opens inline starts streaming in a tab when the visitor wanted it on their laptop for a train journey; a contract that saves silently sends them hunting through a folder when a preview would have answered their question in three seconds. There is a naming consequence as well, because Content-Disposition can dictate the name the file is saved under. The difference between export_final_2.pdf and Acme-Invoice-2026-03.pdf on a client's desktop is one header. For anything meant to be kept — a ZIP archive, an installer, a dataset — forcing the save is nearly always right.

How It Works

The server answers with a 200 and adds Content-Disposition: attachment alongside the usual Content-Type, optionally with a filename parameter naming what to save it as. The browser reads attachment, skips its internal viewer, and writes the body to disk. Without that header it falls back to whatever it can do with the MIME type: render HTML, display a PNG, open a PDF in the reader, and save anything it does not recognise. On the client side, an anchor carrying a download attribute produces the same result for same-origin URLs and is quietly ignored across origins, which is why a cross-domain download button needs the server header to behave. Hosts that offer both an inline address and a download address for one file are simply serving the same object twice with different headers.

Real-World Example

An accountant hosts a 2 MB spreadsheet template on 99helpers at vat-template.99helpers.site. Served inline, it opened in a browser preview, and several clients rang to ask how they were supposed to edit it. Switched to save on click, with a filename of VAT-Return-Template-2026.xlsx, it now lands in their Downloads folder under a name they can still find a week later. The calls stopped.

Common Mistakes

  • Relying on the download attribute for a file on another domain — browsers ignore it across origins and open the file instead of saving it
  • Forcing a save on something people only wanted to glance at — a one-page menu or a single photo is far more useful rendered in the tab
  • Leaving the saved name as your internal one — the client ends up with export_final_2.pdf on the desktop and no memory of what it was

Related Terms

Put a file online in seconds

Drop in a document, an image, a page or a whole static website and share the link — free, with no build step and no server to set up.

Host a file free →