jDownloadsownloads.com


Author Topic: Direct downloads links  (Read 248 times)

0 Members and 1 Guest are viewing this topic.

Offline Akasha

  • Newbie
  • *
  • Posts: 2
Direct downloads links
« on: 07.12.2017 12:33:25 »
We are attempting to provide direct links (e.g www.site.com/jdownloads/file.rar) as opposed to the Joomla SEF links to allow us to cache the files with a reverse proxy. All of the threads that have been posted about this are years old now and the code changes don't work anymore.

Is this possible and if so does it require modification of Jdownloads? Appreciate any assistance.

Offline Akasha

  • Newbie
  • *
  • Posts: 2
Re: Direct downloads links
« Reply #1 on: 13.12.2017 11:14:01 »
Anyone able to assist?

Online ColinM

  • Moderator
  • *
  • Posts: 3.716
Re: Direct downloads links
« Reply #2 on: 14.12.2017 20:26:50 »
Hi
There is no standard way to to have a direct link to the downloadable file itself. There are issues about Joomla! permissions and view Access to be considered so modifying the code would, I suspect, be a "challenge".
You basically want to generate someting like below
<a target="_blank" href="https://www.your-site.com/topLevelDir/nextLevelDir/.../filemame.ext">filename</a>
where the ... represents the rest of the directories.

This would mean modifying file <yoursite>\components\com_jdownloads\views\downloads\tmpl\default.php to expand the category chain and getting the filename part by using the CatID and FileID to make relevant equiries from the database.

This is not something for the faint hearted.  Also you would need to preserve the code over updates as well. Getting it wrong could prove 'interesting'.
Colin