---
title: File links
project: OpenFiles
version: 1.0
section: reference
language: en
license: MIT
url: https://totaljs.es/docs/openfiles/1-0/reference/file-links/
updated: 2026-11-19T07:45:44.888Z
---

# File links

> The public link of a stored file, how to force a download and what the answer contains.

Every file has a public link in this form:

```text
/files/{db}/{id}-{checksum}.{ext}
```

For example `/files/photos/JapO3b1e961f-pn.png`. You get it in the `url` field of every upload answer. Use it as it is; do not build it yourself, because the checksum part is calculated by OpenFiles.

## Open a file

The link needs no token and no sign-in. Anyone who has it can open the file, so put it in an `<img>` tag, a page or an email:

```html
<img src="https://files.example.com/files/photos/JapO3b1e961f-pn.png" alt="Sunset">
```

The answer has the file's content type. For images it also has the size in headers:

```text
HTTP/1.1 200 OK
x-width: 640
x-height: 480
x-size: 2795
content-type: image/png
```

## Force a download

Add `?download=1` to make the browser save the file under its name instead of showing it:

```text
/files/photos/JapMXB1db60f-qt.png?download=1
```

The answer then has:

```text
content-disposition: attachment; filename*=utf-8''sunset.png
```

The name is the current file name, so a file you [renamed](../../guides/rename-remove-files/) downloads with its new name.

## When a link answers 404

- The file was removed, or its storage was dropped.
- The checksum part is wrong, for example because the link was typed by hand.
- The file was uploaded with an ID that contains a hyphen. Use IDs with letters and digits only.
