Re: storing images

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: Adrian Tineo <adriantineo(at)softhome(dot)net>
Cc: <angelo(dot)rigo(at)globo(dot)com>, <pgsql-php(at)postgresql(dot)org>
Subject: Re: storing images
Date: 2003-01-30 21:16:39
Message-ID: Pine.LNX.4.33.0301301415530.22730-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

On Thu, 30 Jan 2003, Adrian Tineo wrote:

>
>
> >I am searching for tutorials to store and properly display images using
> >php-postgresql!
> >
> >What data type must be the image collumn on my database?
> >how can i display the images ?
> >how can i control the size of the stored image?
>
> To include large objects (like images) in the database you need to use
> BLOBs, I think the type for postgresql is "bytea". Check the docs. I seem to
> remember that you inserted them by means of "lo_import" and extracted them
> via "lo_export".
>
> I am designing an application that needs images (who doesn't?) but I have
> decided to store the images separately as usual images (gif, jpg) and store
> in the database the link to those images, so I read the link from the
> database and the php script loads the image from the link. I don't have any
> special requirement for the security of the images, that is, if you knew the
> link yourself you could load it in the browser but that is not important.

This isn't strictly true anymore. You can now use the bytea type to store
binary objects into, but they need to be properly escaped. much easier to
manipulate than those pesky large objects.

In response to

Responses

Browse pgsql-php by date

  From Date Subject
Next Message scott.marlowe 2003-01-30 21:54:26 Re: populating db with PHP
Previous Message scott.marlowe 2003-01-30 21:13:15 Re: URGENT : pgsql for windows