Direct Link
Definition
A direct link is a URL whose response body is the file. No wrapper page, no preview, no button — a browser given one will render the file, play it, or save it, depending on the type and the headers that came with it. The address usually ends in the file's own name and extension, such as /assets/logo.png, which is a decent clue that you are looking at one. Image tags, video players, stylesheets, scripts, RSS enclosures and API clients all need this kind of address, because none of them can read an HTML page and work out which part of it is the real file. A shareable link is the opposite arrangement: built for a person to open, and able to carry a password or a form precisely because there is a page to ask in.
Why It Matters
Anything that embeds a file needs a direct address, and giving it the wrong kind fails in a way that is hard to diagnose. Point an img tag at a viewer page and the browser receives text/html where it expected image/png, so it draws a broken-image icon and reports nothing useful. The same mistake in a podcast feed means every player tries to play an HTML document. Direct links carry a cost as well as a use: because anything at all can fetch them, they are exactly what another site uses when it decides to hotlink your file, and every one of those fetches is billed to your traffic rather than theirs.
How It Works
The request goes to the object's own path and the host answers 200 with the bytes. Three headers decide what the browser does next: Content-Type declares the type so it knows whether to render or save, Content-Length gives the size so a progress bar is possible, and Content-Disposition, when present, can force a save instead of inline display. Range requests work against direct addresses too, which is how a video player seeks into the middle of a file without downloading everything before it. Since the response is identical for every caller, it caches cleanly at the edge — and that same property is what makes it trivially embeddable on somebody else's page.
Real-World Example
A developer hosts a 180 KB logo on 99helpers so three separate sites can share one copy. The address ends in logo.svg, goes into an img tag on each site, and all three render straight away because the response arrives as image/svg+xml. A month later a fourth site, an unrelated forum, starts embedding the same file. The edge analytics name the referrer and show how much traffic belongs to it, which is enough for the developer to decide whether to allow it or swap in a watermarked copy.
Common Mistakes
- ✕Using a viewer page address as the src of an img or video tag — the browser gets HTML instead of the file and shows nothing at all
- ✕Expecting a password to protect a direct address — there is no page in which to ask, so the bytes go to whoever holds the URL
- ✕Assuming any URL ending in .pdf must be direct — plenty of hosts serve a viewer at that address and keep the real file one click further in
Related Terms
Shareable Link
A shareable link is the address you hand to another person so they can reach a file you have hosted. It normally points at a page that presents the file — name, size, a download button — rather than at the raw bytes.
Download Link
A download link is an address that makes the browser save a file to disk instead of displaying it in a tab. The behaviour comes from a header on the response or an attribute on the anchor tag, not from anything inside the file.
Hotlinking
Hotlinking is when another site embeds a file using its address on your host, so every visitor to their page downloads it from you. They get the image; you get the traffic bill.
MIME Type
A MIME type, also called a media type or content type, is the short label a server sends to say what kind of data a response contains — text/html, image/png, application/pdf. The browser decides what to do with the bytes based on that label, not on the file name.
Web Asset
A web asset is any supporting file a page pulls in once the HTML has arrived — stylesheets, scripts, images, fonts, icons, videos. The HTML is the page; the assets are everything it asks for next.
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 →