Page 1 of 1

images from database do not display in chrome [SOLVED]

Posted: Wed Jan 19, 2011 12:08 pm
by mw007
Hi All,

I am making a site where a user can upload and display images. This is straightforward enough in PHP. In fact, this works very well in firefox. Problem is with Chrome. The image appears while the image display page is loading, but as soon as loading is done, the image error icon appears. Has anyone else experienced this with Chrome?

Ideas to try and fix this? Again, it works well in firefox. The display image code is below.

Code: Select all

<?php
require_once('Comic.php');

if (isset($_REQUEST['id'])) {
	$comic = Comic::GetById($_REQUEST['id']);

	header("Content-length: {$comic->imageSize}");
	header("Content-type: {$comic->imageType}");
	echo $comic->image;
	exit;
}


Re: images from database do not display in chrome

Posted: Wed Jan 19, 2011 12:11 pm
by Jonah Bron
I know this doesn't answer your question, but the filesystem is much better suited for storing images. As to your question though, it sounds like there's some sort of data at the end that's (not?) getting out, corrupting the image.

Re: images from database do not display in chrome

Posted: Wed Jan 19, 2011 1:40 pm
by mw007
Jonah Bron wrote:I know this doesn't answer your question, but the filesystem is much better suited for storing images. As to your question though, it sounds like there's some sort of data at the end that's (not?) getting out, corrupting the image.
That's possible. But I think you're right about the filesystem being better for storing images, so I'll go that route. I've just always liked having them in a database so I don't have to deal with permissions 8)

Thanks for the quick reply!