簡體   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