Page 1 of 1
Uploads Module setting
Posted: Tue Mar 14, 2017 4:44 am
by beaconhill
Using Uploads Module V1.25.1 on CMSMS V2.1.5 (latest of both).
I have a summary template showing a list of PDF files that were uploaded using the Uploads Module.
When clicking to view one of these PDF files it first downloads itself before opening locally.
Is there a setting I can tweak that will stop the PDF from downloading before it opens.
IE, the PDF opens file:///C:/Users/Owner/Downloads/my_PDF.pdf
and I need it to open
http://www.mydomain.com/uploads/files/my_PDF.pdf
Thansk you in advance.
Neil
Re: Uploads Module setting
Posted: Tue Mar 14, 2017 10:14 am
by velden
This probably is a setting in the local browser.
Re: Uploads Module setting
Posted: Tue Mar 14, 2017 10:52 am
by Rolf
You tried using the html5 download tag
https://www.w3schools.com/TAGS/att_a_download.asp
Code: Select all
<a href="{$entry->download_url}" title="{$entry->name}">{$entry->name}</a>
Code: Select all
<a href="{$entry->download_url}" title="{$entry->name}" download>{$entry->name}</a>
Re: Uploads Module setting
Posted: Tue Mar 14, 2017 10:43 pm
by beaconhill
Hi Rolf and thanks for your input.
Unfortunately its not a browser setting as links to PDF generated outside of the module behave differently when clicked.
See the issue in action here
http://server.beaconhilldesign.co.nz/~kevinmcdonald/
Click on the folder icon to open the fly out menu.
The list starting with "Buying a house" has been created using the Uploads Module. Clicking on any of these will result in the PDF being downloaded locally first (not what we want).
The link above called "link created outside of the module" has been hard coded into the page and behaves as it should.
My guess is that its a header created by the module however I have no idea as to where I should begin to look.
Thanks again,
Neil
Re: Uploads Module setting
Posted: Wed Mar 15, 2017 10:30 am
by velden
Probably you're right about the header. Not sure how to solve it (I'm not familiar with the Uploads module).
BTW: I can't find your "link created outside of the module" link in the page.
What is your goal using this module? Just offering the downloads to every visitor, or are you using some fancy features?
Re: Uploads Module setting
Posted: Wed Mar 15, 2017 11:00 am
by velden
Checked the source and this module is explicitly forcing a download (by http headers).
You might want to use the 'origfile_url' property of the items but note it might not do what you want (perhaps changing filename, revealing location, skip tracking/analytics, make it public, indexed by search engine etc etc)
Another option would be to do ask the developer of the module if he's willing to extend the module to include extra header options/settings. It might need sponsoring but that's for a good cause, right?

Re: Uploads Module setting
Posted: Wed Mar 15, 2017 8:27 pm
by beaconhill
Hi Velden,
that you so much for the information. I have asked our developer (based on what you have said) to investigate adding the additional header information via the module.
More than happy to close this question.
Best,
Neil
PS: I needed to remove my test link as the site went out to the client for approval yesterday. Apologies if this caused any confusion.