Fixed filesize sometimes zero
This commit is contained in:
@@ -52,14 +52,17 @@ class FileController extends mfBaseController {
|
||||
if (!$fh = fopen($file, 'r')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
set_time_limit(36000);
|
||||
header('Content-Type: application/octet-stream');
|
||||
header('Content-disposition: attachment; filename="' . $name . '"');
|
||||
|
||||
$size = exec('stat -c %s '.escapeshellarg($file));
|
||||
if($size < (pow(2,31))-1) {
|
||||
header('Content-Length: ' . $size);
|
||||
|
||||
if(strlen($size)) {
|
||||
if($size < (pow(2,31))-1) {
|
||||
header('Content-Length: ' . $size);
|
||||
}
|
||||
}
|
||||
|
||||
while (!feof($fh)) {
|
||||
|
||||
Reference in New Issue
Block a user