mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
"Fixing bug in MediaView"
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6604 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
a9d4e821a8
commit
1db7d00793
1 changed files with 4 additions and 4 deletions
|
@ -114,8 +114,8 @@ class MediaView extends View {
|
|||
$name = $id;
|
||||
}
|
||||
|
||||
if (file_exists($path) && isset($extension) && array_key_exists($extension, $this->mimeType)) {
|
||||
$chunkSize = 1 * (1024 * 1024);
|
||||
if (file_exists($path) && isset($extension) && array_key_exists($extension, $this->mimeType) && connection_status() == 0) {
|
||||
$chunkSize = 1 * (1024 * 8);
|
||||
$buffer = '';
|
||||
$fileSize = @filesize($path);
|
||||
$handle = fopen($path, 'rb');
|
||||
|
@ -173,11 +173,11 @@ class MediaView extends View {
|
|||
set_time_limit(0);
|
||||
$buffer = fread($handle, $chunkSize);
|
||||
echo $buffer;
|
||||
@ob_flush();
|
||||
@flush();
|
||||
@ob_flush();
|
||||
}
|
||||
fclose($handle);
|
||||
return;
|
||||
return((connection_status() == 0) && !connection_aborted());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue