html download attribute redirects to url instead of downloading

The problem is because you’re using a cross-domain URL. From the documentation for the download attribute:

download only works for same-origin URLs, or the blob: and data: schemes.

To fix this you need to host the image on the same domain as the parent site.

Leave a Comment