No download in IE, Firefox, or Chrom - works in Opera

Phoca Download - download manager
cmccown
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 10 Sep 2011, 21:45

No download in IE, Firefox, or Chrom - works in Opera

Post by cmccown »

I am having some strange results from a previously configured and working Phoca Download install on Joomla 1.5.x running Ubuntu Server.

I am able to load files for download from the back end, but when trying to download a variety of errors occur as follow:

Internet Explorer (8 and 9): Page cant be displayed after clicking on the download (url shows top level)
Firefox: Brings an open/download dialog box, but throws an error in the back saying no source files (fails download or downloads as 0 bytes)
Chrome: Displays a blank page

However, Opera works without an issue as it did before. I can also download from an Android based phones browser ( i think this is also Opera).

I know some browsers are HTML5 ready, is this the problem or are there other underlying issues? I have performed full uninstalls as well as went and delected all the SQL tables and reinstalled, same issue on all browsers but Opera.

Any suggestions would be greatly appreciated.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48610
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: No download in IE, Firefox, or Chrom - works in Opera

Post by Jan »

Hi, I think this is more the header issue in the document, then e.g. some database problem. But for now I am not able what exactly can be wrong there, tested the download on different servers on different OS, browsers without any problem. Maybe try to recheck the server settings, if there are some limits (??) etc. :idea: really no idea there :-( as this is mostly a question between server and browser (plus its OS) :idea:

Jan
If you find Phoca extensions useful, please support the project
cmccown
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 10 Sep 2011, 21:45

Re: No download in IE, Firefox, or Chrom - works in Opera

Post by cmccown »

Jan,

Thanks for looking into this and ur prompt response. I will use your suggestions and poke around on the server side a bit more and see what caused the crash.

You have the best component out there and appreciate the hard work u put into it.

Thank you again for your help and if I find a fix i'll pass it along to you.

Have a I've day!

Sincerely,

Casey m
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48610
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: No download in IE, Firefox, or Chrom - works in Opera

Post by Jan »

Ok
If you find Phoca extensions useful, please support the project
chozyn
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 31 Oct 2011, 20:54

Re: No download in IE, Firefox, or Chrom - works in Opera

Post by chozyn »

My elegant solution for version 2.0.1 was to edit the file "/components/com_phocadownload/helpers/phocadownload.php" and change these lines (starting at line 108):

Code: Select all

	header("Cache-Control: public, must-revalidate");
	header('Cache-Control: pre-check=0, post-check=0, max-age=0');
	header("Pragma: no-cache");
	header("Expires: 0"); 
	header("Content-Description: File Transfer");
	header("Expires: Sat, 30 Dec 1990 07:07:07 GMT");
	header("Accept-Ranges: bytes"); 
					
	// SSL Support
	// header('Cache-Control: private, max-age=0, must-revalidate, no-store'); // comment above cache-control, pragma, expires
to this:

Code: Select all

	// test for protocol and set the appropriate headers
	jimport( 'joomla.environment.uri' );
	$_tmp_uri =& JURI::getInstance( JURI::current() );
	$_tmp_protocol = $_tmp_uri->getScheme();
        if ($_tmp_protocol == "https") { 
		// SSL Support
		header('Cache-Control: private, max-age=0, must-revalidate, no-store');
	} else {
		header("Cache-Control: public, must-revalidate");
		header('Cache-Control: pre-check=0, post-check=0, max-age=0');
		header("Pragma: no-cache");
		header("Expires: 0"); 
	} /* end if protocol https */
	header("Content-Description: File Transfer");
	header("Expires: Sat, 30 Dec 1990 07:07:07 GMT");
	header("Accept-Ranges: bytes"); 
This allows a user to download the files regardless of the protocol and browser.

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

Re: No download in IE, Firefox, or Chrom - works in Opera

Post by Jan »

Hi, thank you for this guide.

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