CC-2317: Once uploaded, file size is different than original.
This commit is contained in:
parent
ac952ad71e
commit
28a609c4dd
|
@ -85,8 +85,6 @@ class ApiController extends Zend_Controller_Action
|
|||
exit;
|
||||
}
|
||||
|
||||
// !! binary mode !!
|
||||
$fp = fopen($filepath, 'rb');
|
||||
|
||||
// possibly use fileinfo module here in the future.
|
||||
// http://www.php.net/manual/en/book.fileinfo.php
|
||||
|
@ -100,12 +98,15 @@ class ApiController extends Zend_Controller_Action
|
|||
}
|
||||
header("Content-Length: " . filesize($filepath));
|
||||
|
||||
//flush the file contents 16 KBytes at a time. In the future we may
|
||||
//want to use the "X-Sendfile header" method instead.
|
||||
while (!feof($fp)) {
|
||||
echo fread($fp, 64*1024);
|
||||
ob_end_flush();
|
||||
}
|
||||
// !! binary mode !!
|
||||
$fp = fopen($filepath, 'rb');
|
||||
|
||||
//We can have multiple levels of output buffering. Need to
|
||||
//keep looping until all have been disabled!!!
|
||||
//http://www.php.net/manual/en/function.ob-end-flush.php
|
||||
while (@ob_end_flush());
|
||||
|
||||
fpassthru($fp);
|
||||
fclose($fp);
|
||||
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue