PHP image headers and JavaScript loading

ckklghagfda

New Member
I have big problem with displaying images in fancybox.Images are "generated" by PHP with \[code\]header()\[/code\] and \[code\]readfile()\[/code\].When I access script directly from browser everything is ok, but when request comes from fancybox JavaScript suddenly browser stop responding and after long time in load content area I get binary code instead of image.Here is the code:\[code\]ob_clean();header('Content-Type: '.$post->post_mime_type);$name = basename($post->guid);$base = home_url();$path= $_SERVER{'DOCUMENT_ROOT'}.str_replace($base,'',$post->guid);header ('Content-Disposition: inline; filename='.$name);header ('Content-length: ' .filesize($path));readfile($path);\[/code\]Screen of content loaded into fancybox: http://img502.imageshack.us/img502/8535/screenq.png
 
Top