I have a web application that runs through HTTPS, but we are loading external images on servers that don't support SSL. For this reason we need to proxy all external images through a PHP script so they can be loaded over SSL.
I tried following but i get "the image cannot be displayed because it contains errors.".
$remoteImage = "http://www.blog.qarea.com/wp-content/uploads/2012/01/code.jpg";
$imginfo = getimagesize($remoteImage);
header("Content-type: ".$imginfo['mime']);
readfile($remoteImage);
Any thoughts on where I'm going wrong?
MORE INFO: The content length of the request matches the size of the original image. UPDATE: I just tried the script in a stand alone file and it worked fine. Looks like it's an issue with Zend Framework. Now I just need to debug that, any input would be appreciated.