BUG: Download fails with range check

Phoca Download - download manager
Hackwar
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 04 Mar 2022, 12:33

BUG: Download fails with range check

Post by Hackwar »

I updated a website to Joomla 4 and also updated Phoca Downloads. When I try to download a file, I get an error by the browser "can't establish secure connection." Of course, the site has a valid SSL certificate and everything else works fine with HTTPS. Interestingly, this only happened on the live site and not on my local dev machine. So I debugged this a bit and it turns out that in /administrator/components/com_phocadownloads/libraries/phocadownload/download/download.php in line 214 it checks for HTTP_RANGE, which seems to be always set on my server. The additional header in line 224 then makes the whole connection fail and prevents the file from being downloadable. I disabled that if statement for now, but it would be good if you could provide a proper fix as a new release. :-) Thank you!
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48550
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: BUG: Download fails with range check

Post by Jan »

Hi Hannes,

which version of Phoca Download do you use? The latest 4.0.0 Beta?

Do you have any tip to change it? There were many many problems with the headers and that solution I found and tested worked best of all. :idea:

Jan
If you find Phoca extensions useful, please support the project
Hackwar
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 04 Mar 2022, 12:33

Re: BUG: Download fails with range check

Post by Hackwar »

Yes, it is the 4.0.0 Beta. Unfortunately I have no idea about this. I just debugged to this point and when commenting this code, it worked again.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48550
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: BUG: Download fails with range check

Post by Jan »

Ok, all I can think about is add a parameter there. This would also resolve backward compatibility. For you or users with the same problem, it would then be sufficient to turn off this check in the options. :idea:

Jan
If you find Phoca extensions useful, please support the project
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48550
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: BUG: Download fails with range check

Post by Jan »

It can be tested in version 4.0.1:
https://www.phoca.cz/download/category/ ... -component

The parameter (called Check Http Range) can be disabled in Options (last tab - General Options).

Jan
If you find Phoca extensions useful, please support the project
Post Reply