Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Download file with Internet Explorer 7 and 8

Posted on 2009-12-29
3
Medium Priority
?
294 Views
Last Modified: 2013-12-13

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

0
Comment
Question by:Dada44
3 Comments
 
LVL 83

Expert Comment

by:leakim971
ID: 26137107
Hello Dada44,

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

(replace by your $file)

Regards.
0
 
LVL 1

Accepted Solution

by:
AnithaRajesh earned 2000 total points
ID: 26137143
Hi,

<?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: video/flv' );
header( 'Content-Disposition: attachment; filename="'.basename( $file ).'"' );
readfile( $file );  
?>

Have removed content length & changed content type as  video/flv. It works in IE8 check it out in IE7
0
 

Author Closing Comment

by:Dada44
ID: 31670716
thanks!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question