Problems with android browser

Phoca Download - download manager
martijndoes
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 21 Jul 2014, 14:33

Problems with android browser

Post by martijndoes »

Hi all,

I've been using the plugin for a site I've been making and it seems to work perfectly expect in the stock android browser.

Every file that is downloaded through that browser is corrupted. For example if I try to open a pdf file that I downloaded it says: "
The document cannot be opened because it is not a valid PDF file" (in adobe reader). I've also tried with a jpg file but that just doesn't show anything.

Is there something I'm doing wrong?
I'm using Joomla 3.3.1 with Phoca Download 3.0.5
I've tried different versions of Android by the way but they all seem to have the same problem.

Thanks
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48566
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Problems with android browser

Post by Jan »

Hi, really no idea why there should be problems in android. Testing downloading in Android - in Firefox and Chrome browser, get no problem there, tested the PDF and everything Ok.

Try to see your PDF with editor - maybe your server somehow produces php or another error and paste it somehow to download document which can corrupt the header - if you open the PDF with text editor, maybe you will see some error message in the header of the document :idea:

Jan
If you find Phoca extensions useful, please support the project
martijndoes
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 21 Jul 2014, 14:33

Re: Problems with android browser

Post by martijndoes »

Hi Jan,

thanks for your answer. Did you try the stock android browser too? We did notice that the Chrome browser does work in android. The problem only seems to be with the stock browser.

Well that does seem to be part of the problem. It seems to be opening some kind of html output. We tried another pdf viewer and that indeed gives an error about wrong headers. However we are really sure the pdf's are ok. We even tried different PDF generators to generate the output file.
martijndoes
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 21 Jul 2014, 14:33

Re: Problems with android browser

Post by martijndoes »

I think I've found a solution/workaround. Setting "Direct Link" for a file to Yes will open the file correctly.

Is there a pretty way to set this option default to Yes? I could set the database default to 1 but of course that's not preferred solution here.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48566
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Problems with android browser

Post by Jan »

Hi, depends on which way you are adding the file items. If e.g. per multiple add, then the code needs to be customized in PHP - to add 1 for direct link there :idea:

For correcting the current items, the SQL query in e.g. phpMyAdmin is the quickest solution - one sql for all items, e.g.

UPDATE phoca download table SET direct link = 1; (this is not exact SQL query, only draft) This should change all the items

It should look like this:

Code: Select all

UPDATE `jos_phocadownload` SET directlink = 1;
There is no WHERE condition, so it changes every file items
If you find Phoca extensions useful, please support the project
Post Reply