I'm getting a really weird problem, and I don't know a) where the problem actually lies. b) how to determine where the problem lies. c) how to fix it.
I have a website, that basically serves links to download files. Similar in architecture to 'yousendit.com' (but quite different really). Basically a file is created, and php links are given to various people to download the file which identifies the person.
The problem is, although MOST of the downloads for a file will work fine, occasionally every now & then downloads will just 'STOP' downloading in mid-download. It's intermittent, and if the user clicks download again, most often the whole thing will download. I have no idea what's causing it, but I'm desperate to solve it. My first thoughts are that it might be network problems on my shared web hosting environment. Is that possible? Here is the code I'm using to serve the file:
Code: Select all
header('HTTP/1.1 200 OK');
header('Date: ' . date("D M j G:i:s T Y"));
header('Last-Modified: ' . date("D M j G:i:s T Y"));
header("Content-Type: application/octet-stream");
header("Content-Length: " . (string)(filesize($fileHandle)) );
header("Content-Transfer-Encoding: Binary");
header('Content-Disposition: attachment; filename="'.$fileName.'"' );
readfile($fileHandle);Any help would be greatly appreciated as I've been stuck on this one for a whle!
Thanks,
EoN