Quick answer
Add a PDF you have permission to share to your site’s public files. Link to its published address, then click the link from the page a visitor will use. Open the resulting file and check its contents.
Use a short, harmless practice document first. A file placed in a public website folder can be accessed by visitors who know its address. Remove private details before uploading it.
This walkthrough is for an editable static website, where finished files are served directly. A hosted builder may have its own file manager. Check its current instructions for the upload step.
Choose and name the file
Pick one finished PDF, such as a fictional workshop handout. Open it on your computer and check the title, pages and text before adding it to the project.
Use a simple filename such as workshop-handout.pdf. Write down its exact spelling. You will need the same name in the link.
For practice, our existing fictional community workshop PDF is already public. It is the same document used in our PDF-summary tutorial. Download it and inspect it before using a copy in your own test project.
Put it in the folder your site publishes
Ask your coding assistant where the project keeps files that must be copied into the finished website unchanged.
For an Astro project, public/downloads/workshop-handout.pdf is served at /downloads/workshop-handout.pdf. The browser address leaves out public. This mapping follows Astro’s public-folder documentation.
That folder name is specific to this example. Other projects can have different rules, especially when the site is hosted under a subfolder. Ask the assistant to confirm the correct published address from your project.
Open that address in your preview. If it returns a not-found page, fix the file location or spelling before adding a download button. Our 404 guide covers broader deployment checks.
Add a link people can recognize
Use a label that says what the file contains and identifies the format. For example, Download the workshop handout (PDF) is clearer than “Click here.”
In an editable HTML page, a link to a PDF on the same website can use the download attribute.
<a href="/downloads/workshop-handout.pdf" download>
Download the workshop handout (PDF)
</a>
The download attribute asks the browser to treat the URL as a download. It applies to same-origin URLs, meaning the same scheme, hostname and port. Browser settings and response headers can affect the result. A PDF opening in a viewer does not, by itself, mean the link is broken. These limits are documented in MDN’s link reference.
If you use an AI assistant, give it this small request.
Add a link to my existing PDF [file path] on [page].
Confirm the file's published URL from this project.
Label it "Download the workshop handout (PDF)".
Use an ordinary same-site download link where supported.
Show the preview and changed files. Wait before publishing.
Check the file a visitor actually receives
Start from the page containing the link. Click it, then check all three results.
- Destination. It reaches the intended PDF, rather than a login page or an HTML error page.
- Contents. Open the downloaded file or viewer and check the heading, page count and one distinctive detail against your original.
- Access. Test the public link without relying on an editor login. The label should still be readable and easy to select in a narrow-screen preview.
If the link downloads a file with the wrong contents, compare the linked address and deployed file before uploading another copy. If it opens in a viewer, try the browser’s available save control and check that copy too.
Use the safe update process to publish. Repeat the visitor’s journey on your real domain. Finish when the promised PDF is reachable and its contents match the version you approved.