@@ 1003-1005 (lines=3) @@ | ||
1000 | $h403 = 'HTTP/1.x 403 Access Denied'; |
|
1001 | $h404 = 'HTTP/1.x 404 Not Found'; |
|
1002 | ||
1003 | if (($volume = $this->volume($target)) == false) { |
|
1004 | return array('error' => 'File not found', 'header' => $h404, 'raw' => true); |
|
1005 | } |
|
1006 | ||
1007 | if (($file = $volume->file($target)) == false) { |
|
1008 | return array('error' => 'File not found', 'header' => $h404, 'raw' => true); |
|
@@ 1007-1009 (lines=3) @@ | ||
1004 | return array('error' => 'File not found', 'header' => $h404, 'raw' => true); |
|
1005 | } |
|
1006 | ||
1007 | if (($file = $volume->file($target)) == false) { |
|
1008 | return array('error' => 'File not found', 'header' => $h404, 'raw' => true); |
|
1009 | } |
|
1010 | ||
1011 | if (!$file['read']) { |
|
1012 | return array('error' => 'Access denied', 'header' => $h403, 'raw' => true); |
|
@@ 1015-1017 (lines=3) @@ | ||
1012 | return array('error' => 'Access denied', 'header' => $h403, 'raw' => true); |
|
1013 | } |
|
1014 | ||
1015 | if (($fp = $volume->open($target)) == false) { |
|
1016 | return array('error' => 'File not found', 'header' => $h404, 'raw' => true); |
|
1017 | } |
|
1018 | ||
1019 | // allow change MIME type by 'file.pre' callback functions |
|
1020 | $mime = isset($args['mime'])? $args['mime'] : $file['mime']; |