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