Jump to content

corrupted files through fpassthru


Crusader

Recommended Posts

[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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.