Hi
I am creating a webhelp and i have put in some links to files for users to download. However if I link to a PDF file instead of offering to download the file directly, it displays it in the browser.
Anyway of inserting a direct download link?
Thanks
Matt
Download Links
Moderators: Alexander Halser, Tim Green
- Tim Green
- Site Admin
- Posts: 23183
- Joined: Mon Jun 24, 2002 9:11 am
- Location: Bruehl, Germany
- Contact:
Re: Download Links
Hi Matt,
Just tell your users to right-click on the link and select download. Most of them should actually know this already ...
Just tell your users to right-click on the link and select download. Most of them should actually know this already ...
Regards,
Tim (EC Software Documentation & User Support)
Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Tim (EC Software Documentation & User Support)
Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
-
- Posts: 27
- Joined: Wed Apr 22, 2015 4:03 pm
Re: Download Links
Tim, you obviously haven't met our staff
Really just need a one click option
Really just need a one click option
-
- Posts: 454
- Joined: Thu Nov 16, 2006 1:29 pm
- Location: London, UK
Re: Download Links
These browsers support the download attribute in links. This forces the document to be downloaded rather than displayed in the browser. It will default to the same filename as that on the server, or you can provide a custom one. Either way the user will be able to change the name. As far as I can see, browsers like IE and Safari that don't support download silently ignore it.matt harris wrote:Any way of inserting a direct download link?
I found a hack to add this attribute by changing the Internet link to a Script link and using mismatched quotation marks, as in the following screenshot: That hack works OK in H&M 7.0.8 but might not work in H&M 5 (which is what this forum is for) or in future builds. Alternatively, you could implement this either by manually editing your topic files each time you publish them, or by using Insert HTML code object to create the link manually, like the code below.
Code: Select all
<a href="prospect-theory.pdf" download="my-custom-filename.pdf" class="weblink">
Prospect Theory: An Analysis of Decision under Risk (Kahneman & Tversky 1979)</a>
You do not have the required permissions to view the files attached to this post.
- Tim Green
- Site Admin
- Posts: 23183
- Joined: Mon Jun 24, 2002 9:11 am
- Location: Bruehl, Germany
- Contact:
Re: Download Links
Thanks for this, Simon!
I always hesitate to post suggestions like this that aren't supported across all browsers, so the caveats do apply here...
I always hesitate to post suggestions like this that aren't supported across all browsers, so the caveats do apply here...
Regards,
Tim (EC Software Documentation & User Support)
Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Tim (EC Software Documentation & User Support)
Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
-
- Posts: 27
- Joined: Wed Apr 22, 2015 4:03 pm
Re: Download Links
Thanks for your help gents
Yes Simon, I am really am using version 5
As you suggested I couldn't get your hack to work in V5, however I did manage to achieve what I wanted by using the code you gave an an HTML Code object plus a little amendment to show the link as a button instead of text.
<a href="filename.pdf" download=" my-custom-filename.pdf " class="weblink"><button>Download</button></a>
Matt
Yes Simon, I am really am using version 5
As you suggested I couldn't get your hack to work in V5, however I did manage to achieve what I wanted by using the code you gave an an HTML Code object plus a little amendment to show the link as a button instead of text.
<a href="filename.pdf" download=" my-custom-filename.pdf " class="weblink"><button>Download</button></a>
Matt