由于某种原因,我无法正确显示图像,它会剔除错误而不告诉我出了什么问题,有什么主意吗?
代码
$finfo = finfo_open(FILEINFO_MIME_TYPE);
header("Content-type: ".finfo_file($finfo, $filepath));
finfo_close($finfo);
header('Content-length: '.filesize($filepath));
header('Content-Disposition: inline; filename="'.$file.'"');
header('X-Sendfile: ' . $filepath );
标题
HTTP/1.1 200 OK
Date: Mon, 07 Apr 2014 13:45:37 GMT
Server: Apache/2.2.22 (Ubuntu)
X-Powered-By: PHP/5.3.10-1ubuntu3.10
X-Sendfile: /path/image.jpg
Content-Length: 0
Content-Disposition: inline; filename="image.jpg"
Keep-Alive: timeout=5, max=99
Connection: Keep-Alive
Content-Type: image/jpeg
上面的代码确实起作用了,这是x-sendfile在apache中没有正确配置
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句