diff --git a/environment/functions/files.php b/environment/functions/files.php index 06bf7a5..0f8ea0e 100755 --- a/environment/functions/files.php +++ b/environment/functions/files.php @@ -378,9 +378,21 @@ // Prepare disposition $disposition = $force_download ? 'attachment' : 'inline'; - header("Content-Disposition: $disposition; filename=\"" . $name) . "\""; + header("Content-Disposition: $disposition; filename=" . $name); header("Content-Transfer-Encoding: binary"); - print $content; + //print $content; + set_time_limit(0); + $chunksize = 1*(1024*1024); // how many bytes per chunk + $buffer = ''; + $handle = fopen($content, 'rb'); + if ($handle === false) { + return false; + } + while (!feof($handle)) { + $buffer = fread($handle, $chunksize); + print $buffer; + } + return fclose($handle); return((connection_status() == 0) && !connection_aborted()); } // download_contents diff --git a/library/filerepository/backend/FileRepository_Backend_FileSystem.class.php b/library/filerepository/backend/FileRepository_Backend_FileSystem.class.php index ee6a125..a30ea28 100755 --- a/library/filerepository/backend/FileRepository_Backend_FileSystem.class.php +++ b/library/filerepository/backend/FileRepository_Backend_FileSystem.class.php @@ -73,7 +73,7 @@ throw new FileNotInRepositoryError($file_id); } // if - return file_get_contents($file_path); + return $file_path; } // getFileContent /**