How to link to a file so visitors can download it
To link to a file from your TeleportHQ site, upload the file in the Assets Manager, right-click it and choose Copy Asset Link to Clipboard. Then select a button or text on your page, add a link, and paste the address into the URL field. Visitors who click it open or download the file.
Before you start
- Upload the file first. For example, a bakery's
menu.pdf. See How to upload images, videos and files. - Have a button or text on your page to link from. For example, a Download our menu button.
1. Copy the file's link
- In the left sidebar, click Assets Manager.
- At the top of the panel, click the Uploads tab.
- Find the file in the Public folder. You can type its name in the Search box.
- Right-click the file. (Or point at it and click ⋯.)
- Choose Copy Asset Link to Clipboard. You see "Asset link is copied to clipboard".
2. Link your button to the file
- On the canvas, select the Download our menu button.
- Click the link icon in the small bar above the button, or press Ctrl+K (Cmd+K on Mac). The link panel opens on the URL tab.
- Paste the link into the URL field, then press Enter.
- Optional: tick Open in a new tab, so your site stays open behind the file.
See How to add links and buttons.
Check that it worked
Links don't open on the editor canvas. Open Preview or your published site and click the button. The file opens or downloads.
Whether a file opens in the browser or downloads is up to the visitor's browser: TeleportHQ stores the file without a "download" instruction. PDFs and images usually open in the browser tab, where visitors can save them. Files a browser can't show, such as .zip or .docx, download.
Troubleshooting
The link stopped working after I deleted or replaced the file The link points to that exact file. If you delete the file, the link no longer opens it. Upload the new file, copy its link, and paste it into the button again.
I want the file to stay hidden until someone clicks Asset links in TeleportHQ are permanent public addresses. Anyone who has the link can open the file, and no sign-in is needed. This includes files in the Private folder, which is for build and configuration files, not for protecting information. Don't upload files that must stay private, and keep passwords and API keys in Secrets. See How to keep passwords and API keys safe (Secrets).
Good to know
- There's no special "download" link type. A file link is a normal URL link.
- The link keeps working as long as the file stays in your project. The address is a long code, not the file's name.
- To offer the file on several pages, paste the same link on each button.
- Documents such as PDFs always count as used. A picture or video that you only link to (and don't show on a page) is marked as unused in the Assets Manager, so removing unused files would delete it and break the link. See How to rename or delete files (and remove unused ones).