Can't figure out file download...

For Joomla! 1.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
Locked
hjortsberg
Joomla! Explorer
Joomla! Explorer
Posts: 359
Joined: Sun Jun 22, 2008 4:25 pm

Can't figure out file download...

Post by hjortsberg » Thu Aug 16, 2012 3:38 pm

Hi!

I am trying to make a file download view of my component.

I have this

Code: Select all

header("Content-Type: application/vnd.ms-word");
			 header("Content-Length: ".filesize($filename.'.docx'));
			 header('Content-Disposition: attachment; filename='.basename($filename).'.docx');
			 header('Content-Transfer-Encoding: binary');
			 header('Expires: 0');
			header('Cache-Control: must-revalidate');
			header('Pragma: public');
			
			 ob_clean();
			 flush();
			 readfile('tmp/'.$filename.'.docx');
			 unlink('tmp/'.$filename.'.docx');
			
			 exit();
Before that (in the same file) I have a script that creates the file and I know the file is created.

The code above works in Fire Fox (14.0.1) but does not work in Internet Explorer 8 or 9...

Any ideas???

Thanx in advance!

Locked

Return to “Joomla! 1.5 Coding”