![](/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.