News:

Support for jDownloads 3 has been ended
Since 17 August 2023 Joomla.org has discontinued support for Joomla 3.x. Therefore, we will no longer offer official support for our Joomla 3 jDownloads version 3.9.x from January 2024.
Please update your website to the latest Joomla version (Joomla 4 or Joomla 5) as soon as possible. Afterwards, please update jDownloads to the latest published version. The longer you delay, the more difficult the upgrade process for your website is likely to be.

Main Menu
Support-Forum

Download file based on version

Started by Elfangor93, 23.07.2025 19:45:51

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Elfangor93

Hi,

I am using JDownloads to offer installable Joomla Extensions (zip files). Now I would like to provide a download to a specific version of the file, but creating only one Download-Record.

Currently a download link to a file looks like this:
https://www.example.org/index.php?option=com_jdownloads&task=download.send&id=9&catid=8&m=0

It would be nice to select the version which gets downloaded with something like this:
https://www.example.org/index.php?option=com_jdownloads&task=download.send&id=9&catid=8&m=0&version=1.0.5

Without the version query variable it would download the file uploaded and chosen in the download edit form. But with the version query variable provided it would download the corresponding version of this file which needs to be stored at the same folder in the filesystem.

For example:
The file assigned with the download in the form would be "/path/to/folder/my-file-v1.1.1.zip", so this file would be downloaded without the query variable "version". If the query variable version=1.0.5 is provided the file "/path/to/folder/my-file-v1.0.5.zip" would be downloaded.

This would allow to offer different versions of a file without the need of creating new download record for each version.

I hope this was understandable.
I would be willing to contribute the needed code to implement that to the JDownloads project. Is there a github repository or something where we can contribute?

Regrads
Manuel
  •  

ColinM

Hi
I understand your objective. Presently jD has a database entry for each Downloadable file, that contains all of the information such as version, number of downloads, author and so on. There are approximately 60 items for each Download.  This would still need maintaining.

Rather than change the internals of jD. I would suggest that a better way is to create some extra Layouts as these are what shows the information to a user. The layout structure is designed to be extensible, and there is documentation on how to make extra layouts.

A parallel scheme would be to use Joomla Tags, where each tag contained the 'version number' - in Downloads it is a 'release' value. The layout would be organised by Name.
Any such layout could either remain private to yourself or made publically available.  Also I would provide assistance.

Colin


Colin M
  •  

Elfangor93

QuotePresently jD has a database entry for each Downloadable file
And this is exactly what I am asking to extend.

I am fully aware of the layouting possibilities with Joomla, like making template overrides or even new Layouts selectable in the menu item creation. But this does not solve my problem.

I would like to have the possibility to download different versions of a file by using the same endpoint. Thus id and catid in the download link should not change.
https://www.example.org/index.php?option=com_jdownloads&task=download.send&id=9&catid=8&;...

I am restricting the access to downloads with the help of Sesame Pay for Access. With this Component it is possible to restrict the access and direct download of Downloads (also with JDownloads) and only users with the correct subscription are allowed to access the download. Having multiple versions of one download within one record (one ID) would make things much easier and reduces the maintenance workload for a new version release a lot.

If you want I can make a code propsal to implement this. Is there a public git repository where I can contribute?
  •  

ColinM

Hi
jD already has the possibility of a version number.  So this may be shown in in a layout. The look I am suggesting is along the form, where the ordering is by version-number, lowest first.
So several lines of the form, one for each version, :

Download-title    Version-Number  Date   Times-downloaded Description

This meets your requirements and is very flexible - importantly it requires no fundamental change to jD.  Doing it by modifying core code needs much too much testing!!
Colin
Colin M
  •  

Elfangor93

QuoteThis meets your requirements and is very flexible - importantly it requires no fundamental change to jD.
But it would require that I create a new download record in jDownloads everytime I have a new version. This is quite demanding.
So if you dont want such a thing in the jDownloads code, then I probably do it with a system plugin. Catching all requests to https://www.example.org/index.php?option=com_jdownloads&task=download.send and modify the behavior in the plugin.
Would have been nice to include it into jDownloads directly, but I understand that you dont want to touch a running system. ;-)
  •  

ColinM

Hi
Creating new Downloads is not a chore for jDownloads.  You could choose to create numerous Downloads in a session and set them unpublished so they are ready to use. Or have I misunderstood?

How often is there a New version?
Still think using the layout scheme is good and wil serve your reqiurements.
It will certainly be simpler to implement than what the scheme you propose.
Best wishe
Colin
Colin M
  •  

ColinM

Hi
I have tried the layout method - and it does not achieve what you suggest!!
Looks like it does need code.  I will discuss with Arno.
 Best wishes
Colin
Colin M
  •