![](/img/trans.png)
[英]How to stream an HTTP file upload without the Content-Length header?
[英]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.