Anchor tag download attribute binding dmx function

I am used to force a file download instead of opening it in a new browser tab if it is a browser view supported type with the download="" and then adding the link there as well as href. Tried using dmx-bind on download attr but not finding success. Is it something you can fix/add?

dmx-bind:href="‘docs/’ +[0].doc_name" dmx-bind:download="‘docs/’ +[0].doc_name"

The download attribute is just a toggle attribute so you don’t need to give it a value just enter as “download” or download=“true”

Also you don’t need to bind it.


1 Like

The download attribute is not just a toggle, when no value is set then it acts like a toggle, when a value is set then it will use that value for the filename of the download. See the docs that George links to.

1 Like