Re: image thumbnail from blob data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





Sent from losPhone

On Jun 6, 2010, at 3:55 PM, Ashley Sheridan <ash@xxxxxxxxxxxxxxxxxxxx> wrote:

On Mon, 2010-06-07 at 02:37 +0600, saeed ahmed wrote:

hello friends,

image store into database in a blob field, But when I'm trying to retrieve
it from the database then its cause problems.

if I'm trying header( "Content-type: image/jpeg") (if my image type is jpeg), then its working well. but when I'm trying to mixing up this with some HTML code then its not working. Ok I understand its not working because
the header already sent by the browser.

now suggest me what should I use there to retrieve the image from database? I have to mix the HTML code in my script. So is their any other way to do
this without header?

saeed ahmed
http://saeed05.wordpress.com


Have one script that just fetches the image and sets the header for
that, and then fetch the content. I am assuming that you are storing the images separate from the HTML in this case anyway? The only way to have
the image data inline with the HTML that I know of is to base64 encode
the image data, but that won't work on Internet Explorer (other decent
browsers work fine though)

Having said that, it's not generally a good idea to store images as
blobs in my experience. It can create slowdowns in database access, and increases the amount of space the db requires by a lot! What most people
do I've found is to store the image as a file and store the path and
filename to it in the db.

+1

I would reccomend this as well. You may find blobs to be more of hogs then blobs as things go forward. Store the link to the images in your DB and store the images in their own folder on the server. That's been the best way in my experience. Even with images changing out.

GL

Karl

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux