problem downloading files from secure http site using PHP
Posted: Fri Jul 16, 2004 1:48 am
hi all,
I have code written php for downloading a file running on apache. This code works fine on both IE 6 and Netscape 6 from non-secure http site. But i face problem while downloading it from secure http site using IE 6. can one please let me what could be the problem. The code is given below
feyd | Please use
I have code written php for downloading a file running on apache. This code works fine on both IE 6 and Netscape 6 from non-secure http site. But i face problem while downloading it from secure http site using IE 6. can one please let me what could be the problem. The code is given below
Code: Select all
$fileName = path of file + file name
ForceFileDownload($fileName);
function ForceFileDownload($file)
{
$filesize = @filesize($file);
header("Content-Disposition: attachment;
filename=".basename($file));
header("Content-Type: application/octet-stream");
header("Content-Type: application/force-download");
header("Content-Type: application/download");
header("Content-Transfer-Encoding: binary");
header("Pragma:no-cache");
header("Expires:0");
@set_time_limit(600);
readfile($file);
return;
}
?>feyd | Please use
Code: Select all
tags when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]