file delivery script (moved servers, now fails)
Posted: Sat Oct 03, 2009 2:10 am
Hi all,
I have been knocking my head against my desk for hours over this and then spent hours searching everywhere to find anything close to a solution. I have a simple file delivery script (snippet below) which worked fine on its original CentOS Apache server. now moved onto a Windows 2003 IIS server.. this script is not behaving.
What it should do... simply deliver the file. obviously.
What it does instead... delivers the file but it is a blank file... even if I add echo's to my script, nothing appears in the delivered file.. seriously, nothing, not even echo's
What it does (if I set it to deliver a smaller file)... delivers the file perfectly (and if i add echo's.. theyll appear in there too)
The file I need to deliver is about 22MB, please if someone knows what's going on tell me what I can be looking out for. It's not a permission problem I checked all that, and as I said I can deliver small files with it, but large files just come blank. .closest I found to this symptom online was someone whose IIS hangs on large files.. but mine does it.. it simply delivers nothing... what I truely don't understand is the act that echo's don't even come through in the delivered file, that makes no logical sense to me.
(some code snippets so u get what i mean by file delivery)
I have been knocking my head against my desk for hours over this and then spent hours searching everywhere to find anything close to a solution. I have a simple file delivery script (snippet below) which worked fine on its original CentOS Apache server. now moved onto a Windows 2003 IIS server.. this script is not behaving.
What it should do... simply deliver the file. obviously.
What it does instead... delivers the file but it is a blank file... even if I add echo's to my script, nothing appears in the delivered file.. seriously, nothing, not even echo's
What it does (if I set it to deliver a smaller file)... delivers the file perfectly (and if i add echo's.. theyll appear in there too)
The file I need to deliver is about 22MB, please if someone knows what's going on tell me what I can be looking out for. It's not a permission problem I checked all that, and as I said I can deliver small files with it, but large files just come blank. .closest I found to this symptom online was someone whose IIS hangs on large files.. but mine does it.. it simply delivers nothing... what I truely don't understand is the act that echo's don't even come through in the delivered file, that makes no logical sense to me.
(some code snippets so u get what i mean by file delivery)
Code: Select all
// fix for IE catching or PHP bug issue
header("Pragma: public");
header("Pragma: no-cache");
header("Expires: 0"); // set expiration time
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
// browser must download file from server instead of cache
// force download dialog
header("Content-Type: application/force-download");
header("Content-Type: application/download");
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=".basename($filename).";");
readfile($filepath.$filename);
exit();