2019-04-23 17:40:41

I was recommended to add the download atr to href hyperlinks in html, but that doesn't work for me.
Is there a simple way of making a link that will just download the file?

----------
“Yes, sir. I am attempting to fill a silent moment with non-relevant conversation.”
“You don’t tell me how to behave; you’re not my mother!”
“Could you please continue the petty bickering? I find it most intriguing.” – Data (Star Trek: The Next Generation)

2019-04-23 17:45:24

ok lol, I just figured out that you can just link to a zip or an exe to download it, what about text based files?

----------
“Yes, sir. I am attempting to fill a silent moment with non-relevant conversation.”
“You don’t tell me how to behave; you’re not my mother!”
“Could you please continue the petty bickering? I find it most intriguing.” – Data (Star Trek: The Next Generation)

2019-04-23 17:55:39

Hi there.
Make sure you are writing the attribute correctly, thus:
<a href="testfile.txt" download>This is a test file download</a>

I'm not sure if some browsers might argue? I've never had problems myself.
there are ways to force downloads with php and some funky header information but really? the download attribute works.

Nathan Smith
Managing Director of Nathan Tech
It's not disability
It's ability!

2019-04-23 18:27:07

Huh, that's strange, either this computer is wierd, or it only works when the site has a server to run off of, cause I ran this in a xampp localhost instead of just an html file on my comp.

----------
“Yes, sir. I am attempting to fill a silent moment with non-relevant conversation.”
“You don’t tell me how to behave; you’re not my mother!”
“Could you please continue the petty bickering? I find it most intriguing.” – Data (Star Trek: The Next Generation)