Hello.
I am hoping that someone can help me!
I use Phocadownload on my site, and have done for many a year.
It was brought to my attention that when you try to download a document it just displays rubbish rather than allowing you to open it/save it
It opens up in the same window with stuff like this:
%PDF-1.4 %Çì¢ 5 0 obj <> stream xœÍ[[odÅV$òxž’„}¿ðK” NxyÛc¯³öØë hÿH~o¾îsº«Î™{/ÁJlOw×µ«¾ªšÑ>ëD/U'ÒŸ²8ºØûðKßÞì=Û3Ê÷1ºÎyéz绋=U¨ÏÇ2„á£tž¬äuçÉÞWïw›½g6dqÚ…Îx9ÜÓ&ßË*„îÓ˽/ð'k×}ù—qq} ÅB¯Óyƒ¯.ºO@,EsNöG#ó¡ìdн뼓}ÀÞÁÅÞ¢[ügïÏóljÛÅž±F1S‡ÕíµegŽ¨vç²l‹cí´¬w²R#ák}ç”\úøqKúp™‹KÒ^Õ-VÇޙ΅¿æ~ùâ5øÂu:ÚÎë™ÃA¡›ÊÈbï•p‰à_‹-¡–0",~¼Ü7½5RÙÅO°œ|ï§Ë}ž`ð͘ò3Àv±GNëàŠµêµê¼ï… CY§‚Âj?ô¶ÈqÓ¨ìdAEÏ‹ÞhëDöÄ{)¸Ûâ‰tôت§p½í…uV%g࢕1Âõ6i+cr‹êm´qp 'àFõxÁÅVec„Ž‹`7Ò3$‡kÄIzdŽŸÈx#ë a7áM÷-¹½\©Éo0Й ‰“·{iôÚùv€tÀÞS2UQò»%î=PÁ™>„'¿]¦M¯Vˆ‚Ò?ˆÍìë£h½â¦ù>¥§(WˆwáSÔçùþ,ö€àèR€Ò·ÂT@rÐÂz,½1“ðžã×…U¤q(ô¨¡%]~—ÐÞ"iG-sÁº,•4#X˜ø X¾.Ä ±ü=j£·>˜ï6ÁWB†ö’ñ}@™6L.a?;‡¨¸ºÌJ&â]Z2ÞK»Æ{#9ã?,Qùm„9ŒÁ;Í%Æu`n ß¼Û´’ÙþJ8¼¤&aùö°Z§ò–MTXþ¦Z4 jñ „;)´E£C$¼ÕâóÔ
I uninstalled PhocaDownload, and re-instatlled the latest version, but its still doing this?
Any ideas?
TD
Download shows Garbage with Downloading
-
- Phoca Newbie
- Posts: 5
- Joined: 29 Jan 2014, 14:34
- Jan
- Phoca Hero
- Posts: 48568
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Download shows Garbage with Downloading
Hi, do you get this problem in different browsers, the code of the PDF is OK, maybe there is some limit on the server which somehow changes the download of the file - instead of displaying the document the source code is displayed. 
Jan

Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 5
- Joined: 29 Jan 2014, 14:34
Re: Download shows Garbage with Downloading
Hi Jan,
Thanks for the response.
It is happening for me in IE, Safari and Firefox
I have checked with my internet provider and this is their response:
index.php?option=com_phocadownload&view=category&download=2:junior-section-child-protection-policy&id=4:junior-documents&Itemid=783
is it correct to have the colons I have highlighted??
Any other suggestions?
TD
Thanks for the response.
It is happening for me in IE, Safari and Firefox
I have checked with my internet provider and this is their response:
This is the latter part of the link when i click on the download button :"When accessing the pdf file directly, it displays ok, as it also does if a simple html link to the document.
It would seem that the problem is due to the coding of the link pointing to the pdf file."
index.php?option=com_phocadownload&view=category&download=2:junior-section-child-protection-policy&id=4:junior-documents&Itemid=783
is it correct to have the colons I have highlighted??
Any other suggestions?
TD
- Jan
- Phoca Hero
- Posts: 48568
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Download shows Garbage with Downloading
Hi, the link si correct.
For now I cannot say what can be wrong, maybe there is some server settings which is in conflict (I don't say it is not correctly set but it is just in conflict)
Tested on many servers (with different OS, settings, etc.), the code was reviewed by many users in 7 years and together we have selected the method of download (headers) which works.
See e.g.:
https://www.phoca.cz/joomla3demo/phoca-d ... -documents
I think, the one action you can do, is to modify the code, e.g. the headers and test what is working on your server
e.g. headers are set in: administrator/components/com_phocadownload/libraries/phocadownload/download/download.php
As written above, many users (maybe over 100) added different tips in the 7 year history of the extension so I think the best solution for the the download feature was selected. But it always depends on different factors (server, browser, ...) if the download will be Ok.
For now I cannot say what can be wrong, maybe there is some server settings which is in conflict (I don't say it is not correctly set but it is just in conflict)
Tested on many servers (with different OS, settings, etc.), the code was reviewed by many users in 7 years and together we have selected the method of download (headers) which works.
See e.g.:
https://www.phoca.cz/joomla3demo/phoca-d ... -documents
I think, the one action you can do, is to modify the code, e.g. the headers and test what is working on your server

e.g. headers are set in: administrator/components/com_phocadownload/libraries/phocadownload/download/download.php
As written above, many users (maybe over 100) added different tips in the 7 year history of the extension so I think the best solution for the the download feature was selected. But it always depends on different factors (server, browser, ...) if the download will be Ok.

If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 5
- Joined: 29 Jan 2014, 14:34
Re: Download shows Garbage with Downloading
Thanks Jan.
I'll keep searching.
Remember the downloads were working up until somepoint recently, so I am sure that there is something thats changed that is probably outwith Phoca!
I'll keep searching.
Remember the downloads were working up until somepoint recently, so I am sure that there is something thats changed that is probably outwith Phoca!
-
- Phoca Newbie
- Posts: 5
- Joined: 29 Jan 2014, 14:34
Re: Download shows Garbage with Downloading
hi Jan.Jan wrote: e.g. headers are set in: administrator/components/com_phocadownload/libraries/phocadownload/download/download.php
I'm afraid i don't have this path.... There is no folder called libraries under the com_phocadownload
(nor does the zip file for version 1.3.9 contain this folder)
Is this the correct path? (Perhaps this si the problem?)
I cannot find any library that has the phocadownload/download/download.php file in it under either the administartor OR the front end component
TD
- Jan
- Phoca Hero
- Posts: 48568
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Download shows Garbage with Downloading
Hi, this is the path of latest release (3)
In 1.3.9 - it is in:
components/com_phocadownload/helpers/phocadownload.php
Jan
In 1.3.9 - it is in:
components/com_phocadownload/helpers/phocadownload.php
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 5
- Joined: 29 Jan 2014, 14:34
Re: Download shows Garbage with Downloading
Thanks Jan.
Finally worked out what the issue is...There was another plugin on the site that had a blank line outside the php tags. This was messing up the PHP headers, causing phocadownload to treat the code the way it is..
Glad to see that phocadownload is not the problem!
Thanks for your help
TD
Finally worked out what the issue is...There was another plugin on the site that had a blank line outside the php tags. This was messing up the PHP headers, causing phocadownload to treat the code the way it is..
Glad to see that phocadownload is not the problem!
Thanks for your help
TD
- Jan
- Phoca Hero
- Posts: 48568
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Download shows Garbage with Downloading
Ok
If you find Phoca extensions useful, please support the project