note 112360 added to function.fpassthru
| From: | RaulentRoi | Date: | Thu, 06 Jun 2013 14:55:21 +0000 |
| Subject: | note 112360 added to function.fpassthru | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-195083@lists.php.net to get a copy of this message | ||
Passthru didn't work for me for files greater than about 5Mb. Just adding
"ob_end_clean()", all works fine now, including > 50Mb files.
$ToProtectedFile=$pathUnder.$filename
$handle = @fopen($ToProtectedFile, "rb");
@header("Cache-Control: no-cache, must-revalidate");
@header("Pragma: no-cache"); //keeps ie happy
@header("Content-Disposition: attachment; filename= ".$NomFichier);
@header("Content-type: application/octet-stream");
@header("Content-Length: ".$SizeOfFile);
@header('Content-Transfer-Encoding: binary');
ob_end_clean();//required here or large files will not work
@fpassthru($handle);//works fine now
----
Server IP: 195.221.21.36
Probable Submitter: 77.206.254.13
----
Manual Page -- http://php.net/manual/en/function.fpassthru.php
Edit -- https://master.php.net/note/edit/112360
Del: integrated -- https://master.php.net/note/delete/112360/integrated
Del: useless -- https://master.php.net/note/delete/112360/useless
Del: bad code -- https://master.php.net/note/delete/112360/bad+code
Del: spam -- https://master.php.net/note/delete/112360/spam
Del: non-english -- https://master.php.net/note/delete/112360/non-english
Del: in docs -- https://master.php.net/note/delete/112360/in+docs
Del: other reasons-- https://master.php.net/note/delete/112360
Reject -- https://master.php.net/note/reject/112360
Search -- https://master.php.net/manage/user-notes.php