Skip to main content
Participant
Jul 11, 2022 12:29 AM UTC
Answered

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

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

 

This topic is closed to new replies. Start a new post to keep the conversation going.
BenPleysier
BenPleysierCorrect answer
Community Expert
Jul 11, 2022 1:39 AM UTC

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

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!

5 replies

BenPleysier
Community Expert
BenPleysierCommunity ExpertCorrect answer
Community Expert
Jul 11, 2022 1:39 AM UTC
Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Liam Dilley
Inspiring
Jul 11, 2022 2:57 AM UTC

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.

Translate
B i r n o u
Legend
Jul 11, 2022 5:27 AM UTC

I'm surprised too

Translate
Participant
Jul 11, 2022 12:29 AM UTC

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

Translate
Nancy OShea
Community Expert
Community Expert
Jul 11, 2022 6:10 PM UTC

 

@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.

 

Translate
Nancy O'Shea— Product User & Community Expert