HTML download attribute

I’m trying to create a button to download a CMS image. I know you can’t use the download attribute as a custom attribute on the designer. I have followed the advice of other forum posts that said to get around this by adding the attribute in a HTML embed object. Here is my code for that:

The html download attribute is supposed to direct download the image but instead it is just opening the image in the browser. Could it be because I’m using a custom domain but the image is hosted at //uploads-ssl.webflow.com…?

Yep. Only works for same-origin assets.

any chance you could explain what that means. Where do I need to host a file from Webflow to get this to work?

thanks for any help

See → Same-origin policy - Web security | MDN (mozilla.org)

TLDR; since the asset and the custom domain are not the same origin you can’t use the download attribute on an anchor tag. Since Webflow only allows you to upload assets to the asset CDN you cannot do this on Webflow.

2 Likes

Thanks for the quick replay Jeff. So do you know any way to set up a link to force download?

You can explore doing this with custom code.

Could you possibly give me any guidance? I don’t now where to start.

Usually stackoverflow is a good source for stuff like this. Here is a topic that might help you achieve what you want. You would need to review and try answers as needed. It’s an older topic that has newer answers.

I coding is not your thing you could enlist the paid help of a developer in the freelance category.