Re: Problem Displaying Images
| From: | Prathaban Mookiah | Date: | Mon, 26 Jun 2006 01:57:21 +0000 |
| Subject: | Re: Problem Displaying Images | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-238599@lists.php.net to get a copy of this message | ||
Oh sorry. I use addslashes().
---------- Original Message -----------
From: Chris <dmagick@gmail.com>
To: Prathaban Mookiah <prathap@ee.pdn.ac.lk>
Cc: "php-general@lists.php.net" <php-general@lists.php.net>
Sent: Mon, 26 Jun 2006 07:14:42 +1000
Subject: Re: [PHP] Problem Displaying Images
> Prathaban Mookiah wrote:
> > I am trying to manage images with a web database application. It works
fine
> > with MySQL 5.0.17 and PHP 5.1.1.
> >
> > But when I port it to another machine that runs MySQL 3.23.54 and PHP 4.2.
2, I
> > have problems viewing the images retrieved from the database in the
browser.
> >
> > The relevant part of the code is:
> >
> > $Result = mysql_fetch_array($Resource);
> >
> > if (!empty($Result["data"]))
> > {
> > header("Content-Type: {$Result['mime']}");
> > echo $Result["data"];
> > }
> >
> > But I see that some binary data is being echoed on to the client. But I
guess
> > it is corrupted in some way such that the browser cannot display it as an
> > image. In fact I tried to save it as an image file, and the image viewer
> > reported it as invalid format.
>
> How are you putting it into the database? Are you using
> mysql_real_escape_string or mysql_escape_string, or are you using
> addslashes or something else?
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
------- End of Original Message -------