I'm not really sure what field this problem falls under, but my closest bet would be php configuration. Here's the problem, I have an ecommerce platform from SumEffect called Digishop that is php based. The downloading feature allowing customers to download products is causing an error which means my customers can't get their products. SumEffect support has washed their hands of the problem saying that the problem is mine. Without remonstrating me regarding whether I'm suited to run a server could someone take a look at this code and error message and make an enlighted guess as to what things I might try to fix it?
Server 2008 R2
IIS 7.5
PhP 5.3.6
Here's the Code
<?php
$path = 'C:/Documents/Virtualsetworks/files/VSPHD1080S164.zip';
$downloadFile = basename($path);
$filesize = filesize($path);
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . $downloadFile . '"');
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
if($filesize){
header('Content-Length: ' . $filesize);
}
header('Content-Encoding: chunked'); //This is passed so in case the default encoding of the server uses compression a progress bar will display.
$handle = fopen($path, 'rb');
$chunksize = 1024;
$length = 0;
ob_start();
while($line = fread($handle, $chunksize)){
echo $line;
ob_end_flush();
ob_flush();
flush();
ob_start();
}
fclose($handle);
ob_end_clean();
?>
Here's the error on the client side:
"F:\E\temp\VSPHD1080S164(13).zip.part could not be saved, because the source file could not be read.
Try again later, or contact the server administrator."
My clients get this too, it's not just me.
It usually reads between 9 and 10 megs of the file and then stops, waits a bit, and then throws that message. Sometimes it reads 0 bytes, or just a few bytes, but mostly it goes to 9.3MB. PHP.ini memory_limit is 128Mb, max-execution time is 1200. The folder has all the correct security permissions. The files in question are between 100-500Mb.
Any help would be appreciated