so i have this problem with hyperlink attribute download. basically i have link that download a certain file. however it doesnt work..
<a href="somelink/somefile.txt" download="" class="external">download file</a>
With this format, it will download the file but it will give me an failed file says 'no file'.
On the other hand if i have link that has a complete uri format:
<a href="http://wwww.somesite.com/somelink/somefile.txt" download="" class="external">download file</a>
It redirects me to the page and it will just show the file. The weird thing is when I tried it on mozilla and brave browser. it works. but in safari, and my default is google chrome. its not working..
Am I missing something? maybe in my header? really appreciate if you can help.. thanks!
it turns out, my problem is conflicted by same origin urls. Apprently, I am rquesting from different hosts/site, for further explanation see : https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy
If you look at here https://www.w3schools.com/TagS/tag_a.asp
Scroll down to attributes, and you will see that the DOWNLOAD attribute is only supported by HTML5, which, as it seems, your friend's version of Safari does not support. I recommend updating the program.
Alternatively, you can right-click on the download link, then click Save As..., then download it that way.
©2020 All rights reserved.