seeker
New member
Since we updated to VB 4.2.2 the amount of memory we have had to alott php has doubled for this script. That said this is probably more of a VB problem than the download mod.
But my question is why does this mod need so much memory anyway? We use other php download scripts that stream the file immediately and consume very little memory. This scripts seems to buffer the whole file then opens the download prompt.
Here is a snip of code from our other scripts.
But my question is why does this mod need so much memory anyway? We use other php download scripts that stream the file immediately and consume very little memory. This scripts seems to buffer the whole file then opens the download prompt.
Here is a snip of code from our other scripts.
header('Content-Type: application/octet-stream');
// more reliable across browsers this way
header('Content-Disposition: attachment; filename="'.$filename.'');
$fp = fopen($filepath,"rb");
$out = fopen("php://output","wb");
$count=0;
while (!feof($fp)) {
$buff = fread($fp, 8192);
fwrite($out,$buff);