Skip to main content
Participant
July 11, 2022
Answered

Re: Force link to download file [Branched from 2018 topic.]

  • July 11, 2022
  • 2 replies
  • 546 views

Can you please share the code for me? I can't understand very well, I'm a beginner. 🇧🇷

 

This topic has been closed for replies.
Correct answer BenPleysier

See here https://www.w3schools.com/TAGS/att_a_download.asp

2 replies

BenPleysier
Community Expert
BenPleysierCommunity ExpertCorrect answer
Community Expert
July 11, 2022
Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Liam Dilley
Inspiring
July 11, 2022

Supprised no one picked up on what Ben posted.
Download is one attribute you just add to HTML so you do not need to do anything else.
Key note though is that different browsers do read this differently. If you have a dynamically generated file for example Chrome does have issue triggering this properly so it is recomended that rather than just adding "download" if you do come across issues to specify the file name download="myfile" as per the docs Ben kindly linked.

Less is more, this is defiantly less.

B i r n o u
Legend
July 11, 2022

I'm surprised too

Participant
July 11, 2022

it worked in your example, but i replicated it in my html using a mobile editor and it didn't work, any tips please?

Nancy OShea
Community Expert
Community Expert
July 11, 2022

 

@Alok25195406pb2h,

It failed because the code I posted in 2018 was intended for the .htaccess file, not the HTML file.   .htaccess is a server configuration file, not a web page.

 

Use @BenPleysier's answer above.

 

Nancy O'Shea— Product User & Community Expert