Dada44
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 );
?>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks!
Try example one here : http://www.php.net/manual/en/function.readfile.php
(replace by your $file)
Regards.