php头中Content-Length的用途是什么


what is the use of Content-Length in php header?

我使用以下代码下载文件

$full_path_file=ctrl_options::GetSystemOption('sentora_root') . "etc/tmp/". basename($backup);
$file_for_user=basename($backup);
header('Content-Description: File Transfer');
header("Content-type: application/octet-stream");    
header('Content-Disposition: attachment; filename="'.$file_for_user.'"');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($full_path_file));
readfile($full_path_file);

它将是下载文件与faullt,因为我不会解压缩一个文件。我将评论下面的

header('Content-Length: ' . filesize($full_path_file));

它运行良好。让我知道标题的clearcut功能('Content-Length:'.filesize($full_path_file));?

我认为,在下载任何文件之前,浏览器应该知道您下载的文件大小。浏览器/下载管理器可以管理下载、部分下载数据等