Link to home
Start Free TrialLog in
Avatar of Dada44
Dada44Flag for Spain

asked on

Download file with Internet Explorer 7 and 8


Dear all,

The code below downloads the file in $file when used with all browsers, but it downloads a 0kb file when used with  Internet Explorer 7 and 8..

What do I have to add to the script to make it work for Internet Explorer 7 and 8 also??

Thanks a lot
<?php

$file ="http://www.turismosevilla.tv/player/1.flv";

header( 'Expires: Mon, 1 Apr 1974 05:00:00 GMT' );
header( 'Pragma: no-cache' );
header( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' );
header( 'Content-Description: File Download' );
header( 'Content-Type: application/octet-stream' );
header( 'Content-Length: '.filesize( $file ) );
header( 'Content-Disposition: attachment; filename="'.basename( $file ).'"' );
header( 'Content-Transfer-Encoding: binary' );
readfile( $file );  
?>

Open in new window

Avatar of leakim971
leakim971
Flag of Guadeloupe image

Hello Dada44,

Try example one here : http://www.php.net/manual/en/function.readfile.php

(replace by your $file)

Regards.
ASKER CERTIFIED SOLUTION
Avatar of AnithaRajesh
AnithaRajesh
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dada44

ASKER

thanks!