Aşağıdaki kod ile, küçük dosyalar boş dosyaları neden ancak büyük (bakınız, 800MB ve üzeri), ince sunulmaktadır!
Bunu çözmek için apache ile bir şeyler yapmak gerekir?
    <?php
    class Model_Download { 
        function __construct($path, $file_name) {
$this->full_path = $path.$file_name;
    }
    public function execute() {
        if ($fd = fopen ($this->full_path, "r")) {
            $fsize      = filesize($this->full_path);
            $path_parts = pathinfo($this->full_path);
            $ext        = strtolower($path_parts["extension"]);
            switch ($ext) {
                case "pdf":
                    header("Content-type: application/pdf"); // add here more headers for diff. extensions
                    header("Content-Disposition: attachment; filename=\"".$path_parts["basename"]."\""); // use 'attachment' to force a download
                break;
                default;
                    header("Content-type: application/octet-stream");
                    header("Content-Disposition: filename=\"".$path_parts["basename"]."\"");
                break;
            }
            header("Content-length: $fsize");
            header("Cache-control: private"); //use this to open files directly
            while(!feof($fd)) {
                $buffer = fread($fd, 2048);
                echo $buffer;
            }
        }
        fclose ($fd);
        exit;
    }
}
Düzenleme: Ben kullanıyorsanız
            fpassthru($fd); exit;
Bunun yerine, ben bir dosya içinde yazılı aşağıdaki olsun:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 786032641 bytes) in /Users/aaron/Sites/com/library/Model/Download.php on line <i>44