Page 1 of 1
BUG: Download fails with range check
Posted: 04 Mar 2022, 12:38
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!
Re: BUG: Download fails with range check
Posted: 04 Mar 2022, 23:35
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.
Jan
Re: BUG: Download fails with range check
Posted: 07 Mar 2022, 17:40
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.
Re: BUG: Download fails with range check
Posted: 07 Mar 2022, 22:49
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.
Jan
Re: BUG: Download fails with range check
Posted: 04 Apr 2022, 14:00
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