Download link in feature description opens new tab instead of downloading
I configured my layer's feature description with a download link of a pdf file. When I click on the link, a new tab opens to display the pdf instead of downloading it.
I've tried all of the below and nothing works. Any ideas? What am I missing..
<a href="{DocumentUrl}" download>Download Document</a>
<a href="{DocumentUrl}" download="document">Download Document</a>
<a href="{DocumentUrl}" target="_blank">Download Document</a>
0
-
Hi Alice,
Are you using Internet Explorer? Unfortunately Internet Explorer does not support the download parameter. If you try Chrome it should work as expected.
Regards,
Wayne0 -
FYI, here is what I referred to - https://caniuse.com/#feat=download 0 -
Hi!
I'm using Chrome and the Html5Viewer is version 2.10.
The download link works with .tif files but for .txt and .pdf, a new tab will open.0 -
OK, in that case, please check out this article -
https://www.computerhope.com/issues/ch001114.htm
it shows the setting in Chrome that needs to be changed.
Regards,
Wayne0 -
I don't think that's the right approach to take in my case. If I want to have a "view document" link and another "download document" link in the feature description, disabling the pdf setting in Chrome would only allow me to do one or the other. 0 -
The problem is the user's browser settings determine what happens to a link when it's clicked on, it's not possible to force a certain behaviour. Browsers intentionally do this due to the security risks with downloading files and clicking links
Perhaps someone else has had some success and can join in this conversation.
Regards,
Wayne0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
6 kommentarer