jDownloads Support Forum

Older Versions => jDownloads 3.2 (Support ended) => General => Topic started by: Akasha on 07.12.2017 12:33:25

Title: Direct downloads links
Post by: Akasha 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.
Title: Re: Direct downloads links
Post by: Akasha on 13.12.2017 11:14:01
Anyone able to assist?
Title: Re: Direct downloads links
Post by: ColinM 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