Skip to main content
Boletolibre

Why a PDF downloads with the wrong filename after a website move

The PDF can be the right document and still save as the wrong file name. After a website or file-host move, an attendee may receive programme-2025.pdf instead of programme-2026-fr.pdf, or a storage key instead of a human-readable name. The useful question is which layer suggested that name. Follow one public download from the page to its final response, change the layer you control, and retest the saved file.

Boletolibre editorial team

Published

Four numbered stages show a website link, redirect, final PDF response and browser save action, with the response stage emphasized.
Read the final file response before changing the page link or clearing a cache.

1. Confirm the filename symptom

First open the public link as a visitor and verify that the PDF itself has the approved edition, language and content. Record separately the visible link text, browser viewer title and actual filename after Save As or a download. A viewer opening inline is not the same outcome as an attachment download; Content-Disposition can signal either behavior, and the user's browser settings may affect what happens.[3]

If the document is wrong, or the URL fails, stop this filename diagnosis and repair the content or link instead. Do not rename an obsolete PDF to make the symptom disappear. Use a fresh test with no signed token, personal address or private document in the evidence you share.

2. Follow the link to the final file response

Inspect the rendered anchor's href and any download value, then follow the request through redirects to the final file URL. The HTML download value is a suggested local name when the browser honors it; it is not a command to a different file host. Record whether the final file is on the page's origin or an external host.[2][4]

Inspect the response to the actual PDF GET that produced the file, especially Content-Type and Content-Disposition. A redirect's header is not the final file's header. If an inline viewer makes a separate request when the visitor chooses Save As, compare that request too. A HEAD-only check may miss the response the browser used.[1][3]

3. Separate the page hint from the response name

Content-Disposition can request attachment or inline behavior and may suggest a filename. Its filename* form carries an encoded international name; when both forms are understood, filename* is preferred, while filename can serve as an ASCII fallback. The name remains advisory: browsers and operating systems may adjust unsafe or unsupported characters.[1][3]

Observed final response and linkLikely naming inputNext check
Attachment with filename or filename*Final response suggests the saved nameCompare it with the approved document and actual browser save
Inline with filenameViewer may open; Save As may use the headerInspect the GET used for Save As and test the browser
No response filename; same-origin download hintHTML hint may be used if honoredTest real click and saved name; do not infer from markup
External file host with a page download hintPage hint is not a reliable cross-origin overrideAsk the final-response owner to inspect its header

The page's download attribute can suggest a name for a same-origin link when honored. It is not a reliable cross-origin repair; MDN notes the same-origin limit and that a final response filename can take precedence over the HTML suggestion. Read the actual response and browser outcome instead of assuming one attribute wins everywhere.[4]

4. Capture one safe, comparable trace

Keep a small redacted comparison: page URL, anchor href and download value, redirect destinations, final origin/status/Content-Type/Content-Disposition, expected document version and observed saved name. Capture the browser and its save action. Repeat from the public route, not an editor preview with different access or response headers.[3]

If the final response has no filename, an opaque URL segment may become the browser's fallback. If the header names an old edition, identify who controls that response: origin server, object metadata, file service or CDN configuration. Do not infer a cache defect merely because the symptom appeared after a move; compare fresh and existing responses before any cache change.[1]

5. Work through a fictional mismatch

Illustrative case: the page links to a French 2026 programme and has download="programme-2026-fr.pdf". After a redirect, files.example serves the correct PDF with Content-Disposition: attachment; filename="programme-2025.pdf". The visitor saves the correct document under the older name. The cross-origin page hint is not the dependable fix.

The file-host owner changes the final response to suggest the approved 2026 name, then checks the public link and a direct file request. If accented characters are required, use a correctly encoded filename* plus a safe ASCII filename fallback. This is a made-up diagnostic example, not evidence that a migration always changes filename headers.[1][4]

6. Change one owner-controlled layer and retest

Correct the layer that actually supplied the stale name. If you control the final response, update its Content-Disposition or the asset metadata that generates it. If there is no response filename and the file is same-origin, a page download hint may help, but confirm the delivered behavior. For an external file host, ask its owner for a response-level fix rather than assuming the page can override it.[1][3]

After one change, retest the public page click and direct final URL in the browsers your visitors use. Verify document content, saved name, language/edition, viewer versus download behavior and the final response. Keep the prior header or asset configuration for rollback. Escalate a browser-specific mismatch with the redacted GET trace; do not prescribe a blanket cache purge from one anecdote.[4][2]

7. Copy the diagnostic worksheet

Copy the editable card, fill the observed and expected columns, and give the correction to the owner of the final response. Leave unknown fields unknown until a real visitor-path test supplies evidence. Do not record signed URLs, cookies, authorization headers or attendee data.

Evidence fieldWhat to record
Visitor pathPublic page, link text and test browser
Link and hopsRedacted href, download value and final URL/origin
Final responseGET status, Content-Type and Content-Disposition
OutcomeCorrect PDF/version? Actual saved name versus approved name?
ActionResponse owner, one change, retest and rollback

Download the editable PDF filename trace

Sources and further reading

  1. RFC 6266: Content-Disposition in HTTPIETF / RFC Editor · Accessed
  2. HTML Standard: links and downloading resourcesWHATWG · Accessed
  3. Content-Disposition response headerMDN Web Docs · Accessed
  4. HTML anchor element: download attributeMDN Web Docs · Accessed