Page 1 of 1

problem downloading files from secure http site using PHP

Posted: Fri Jul 16, 2004 1:48 am
by Shyam
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

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]

Posted: Fri Jul 16, 2004 4:31 am
by JAM
Not to familiar with https unfortnately. But im most certain that I've read somewhere that HTTPS has some sort of bug, that requires the following to be blank:

Code: Select all

header("Pragma: ");
  header("Cache-Control: ");