BUG: Download fails with range check
-
- Phoca Newbie
- Posts: 2
- Joined: 04 Mar 2022, 12:33
BUG: Download fails with range check
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!
- Jan
- Phoca Hero
- Posts: 48550
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: BUG: Download fails with range check
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.
Jan
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.

Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 2
- Joined: 04 Mar 2022, 12:33
Re: BUG: Download fails with range check
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.
- Jan
- Phoca Hero
- Posts: 48550
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: BUG: Download fails with range check
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. 
Jan

Jan
If you find Phoca extensions useful, please support the project
- Jan
- Phoca Hero
- Posts: 48550
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: BUG: Download fails with range check
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
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