#1) The following code seems to corrupt the file download if it's larger than 2MB (e.g. 4MB zip file gets corrupted), anybody have any ideas?
I have the following enabled:
ini_set("memory_limit", "32M");
ini_set("max_execution_time","0");
-------------------------------------------------------------------
# 2 solved!
PHP:
header("Content-Disposition: attachment; filename={$this->settings['realname']}");
header("Content-Type: {$this->settings['mimetype']}");
//header("Content-type: application/octet-stream");
header("Content-Length: {$this->settings['filesize']}");
//header("Connection: close");
header("Pragma: no-cache");
$fp = fopen(/path/to/download,"rb");
//$fp = fopen(/path/to/download,"r");
// sleep(1);
fpassthru($fp);
//print fread($fp,filesize(/path/to/download));
fclose($fp);
flush();
exit();
I have the following enabled:
ini_set("memory_limit", "32M");
ini_set("max_execution_time","0");
-------------------------------------------------------------------
# 2 solved!
Last edited:





