Crusader Posted December 10, 2006 Share Posted December 10, 2006 [code]<?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(); ?>[/code]I'm having a slight problem here... It downloads zip files 2MB or under fine but if you download something 4MB or higher the zip file becomes corrupted.I have the following enabled:ini_set("memory_limit", "32M");ini_set("max_execution_time","0");Any help would be great, thanks! Link to comment https://forums.phpfreaks.com/topic/30096-corrupted-files-through-fpassthru/ Share on other sites More sharing options...
fert Posted December 10, 2006 Share Posted December 10, 2006 [code]ini_set("max_execution_time","0");[/code]change that to[code]ini_set("max_execution_time","300");[/code] Link to comment https://forums.phpfreaks.com/topic/30096-corrupted-files-through-fpassthru/#findComment-138367 Share on other sites More sharing options...
Crusader Posted December 10, 2006 Author Share Posted December 10, 2006 Thanks but the Zip downloaded was still corrupted. Link to comment https://forums.phpfreaks.com/topic/30096-corrupted-files-through-fpassthru/#findComment-138368 Share on other sites More sharing options...
Crusader Posted December 12, 2006 Author Share Posted December 12, 2006 Does anybody else have any ideas? Link to comment https://forums.phpfreaks.com/topic/30096-corrupted-files-through-fpassthru/#findComment-139386 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.