繁体   English   中英

为什么Content-Length HTTP标头与磁盘文件大小不同?

[英]Why is the Content-Length HTTP header from not the same as on disk file size?

如果我使用PHP的get_headers()返回图像文件的Content-Length,那么如果将其保存到磁盘(OSX),为什么它与文件的大小不匹配?

protected function checkRemoteFile($url)
{
    $headers = get_headers($url,1);
    $size = $headers['Content-Length'];
    return $size;

}

可能是因为内容是使用Content-Encoding:gzip发送的。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM