I've stored all my images in database (Mysql), but when I whant to see that image with Fancybox, it display on开发者_JAVA百科ly the binary data, not the image.
My code:
<a href="/controller/action/id" class="group" rel="fancy">
<img src="/controller/action/id/thumb" />
</a>
For url "/controller/action/id" I use this code to return the image:
header("Content-type: {$image['Image']['image_type']}");
echo $image['Image'][ $size ];
I use CakePHP.
Thanks.
$.fancybox({
'type':'image'
});
This solved my problem.
Nedd to specify 'type': 'image'.
精彩评论