added content-length to file download
This commit is contained in:
parent
d47c681629
commit
2334333c53
@ -161,6 +161,13 @@ class File extends Controller
|
|||||||
header("Content-Type: application/octet-stream");
|
header("Content-Type: application/octet-stream");
|
||||||
header("Content-Disposition: attachment; filename={$name}");
|
header("Content-Disposition: attachment; filename={$name}");
|
||||||
header("Content-Transfer-Encoding: binary");
|
header("Content-Transfer-Encoding: binary");
|
||||||
|
|
||||||
|
header('Expires: 0');
|
||||||
|
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
|
||||||
|
header('Pragma: public');
|
||||||
|
$fsize = @filesize($path);
|
||||||
|
if ($fsize !== FALSE) header("Content-Length: {$fsize}");
|
||||||
|
|
||||||
flush ();
|
flush ();
|
||||||
$x = @readfile($path);
|
$x = @readfile($path);
|
||||||
if ($x === FALSE)
|
if ($x === FALSE)
|
||||||
|
Loading…
Reference in New Issue
Block a user