
The HTML download attribute is not a universal command to save any remote image. MDN documents it for same-origin URLs, same-origin blob URLs and data URLs. For other URLs it can be ignored and normal navigation can occur, while the response server may still request a download with Content-Disposition.
Key Takeaways
- Opening an image URL and honoring a download hint are different behaviors.
- The source origin and response headers matter.
- Browser settings can still influence saving and opening.
Identify the effective URL and response
Record the page origin, linked image origin and result observed after clicking. An image that opens successfully is different from a link that returns a sign-in page or error.
The MDN anchor-element reference explains the download attribute's origin limits, suggested filenames and interaction with Content-Disposition. It also says download behavior varies with browser and user settings.
- Confirm that the link retrieves the approved image.
- Inspect whether the destination is within the documented origin scope.
- For a controlled delivery server, review its Content-Disposition and image response.
- Use the website's supported download route rather than changing the label alone.
- Test the actual result in the browsers required by the brief.
Do not rename a navigation link “Download” and assume its behavior changed.
A hypothetical cross-domain asset button
Suppose a site page links to a photograph on a separate asset host. Adding download to the page's anchor may not be honored under the documented cross-origin rule. The asset host's supported delivery response becomes a separate implementation decision.
A developer can configure an authorized download endpoint or server response they control, preserving normal access requirements. This guide does not propose bypassing another service's permissions.
The blob-preview handoff guide concerns a browser-held object's lifecycle. A valid hosted image opening in a tab is a different problem from sharing a local preview identifier.
Verify file identity as well as button behavior
Check the downloaded content, visible revision and proposed filename. MDN notes that Content-Disposition's filename can override the attribute's suggested name, and filesystems can alter prohibited characters.
A browser may prompt, save automatically or open a saved file according to its configuration. Define acceptance in terms of obtaining the intended image through the supported route rather than forcing one identical dialog on every device.
If the saved content is HTML, investigate retrieval rather than the download hint. Accept only when the expected recipient can obtain and open the approved asset with the required filename handling understood.
Related tasks
- Why Does a blob: Image Link Open for Me but Not for My Client?
- Why Does My Downloaded Image Open as a Web Page?
- Can I Use a Temporary AI Download Link as My Product Feed Image URL?
Sources and scope
- MDN HTML anchor element: download: download origin scope, cross-origin navigation, filename precedence and browser-dependent handling.
Documentation-based guidance. Scenarios and acceptance procedures are proposed or hypothetical; no hands-on test, account change, benchmark, search-volume measurement or AI-citation ranking is claimed.
Prepared by Imagild Editorial, the company editorial team responsible for these guides. AI assisted research and drafting. This is documentation-based guidance with proposed examples, not a claim of hands-on testing or an independent product review. Report a correction.
Cover: AI-generated conceptual editorial illustration; not a real application screenshot, observed output or before-and-after test.