Re: Storing images as BYTEA or large objects - Mailing list pgsql-general

From Gevik Babakhani
Subject Re: Storing images as BYTEA or large objects
Date
Msg-id 001101c86e1e$82c19ca0$0a01a8c0@gevmus
Whole thread Raw
In response to Re: Storing images as BYTEA or large objects  (Koen Vermeer <koen@vermeer.tv>)
Responses Re: Storing images as BYTEA or large objects
List pgsql-general
In hour case we where switching between databases so what I have done in the
past was:

For inserting:

1. create a TEXT column in my table. (In PG this can be 1GB in size)
2. read file contents in a buffer/string and Base64 encode that string.
3. write the string into db.

For reading:

1. read the text column into a buffer/string Base64 decode to get your
original image/binary data.

The approach above worked for us. This was a PHP5 website and C# frontend.

Regards,
Gevik Babakhani
------------------------------------------------
PostgreSQL NL       http://www.postgresql.nl
TrueSoftware BV     http://www.truesoftware.nl
------------------------------------------------



> -----Original Message-----
> From: pgsql-general-owner@postgresql.org
> [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Koen Vermeer
> Sent: Wednesday, February 13, 2008 9:43 AM
> To: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] Storing images as BYTEA or large objects
>
> On Tue, 2008-02-12 at 17:16 -0700, Leonel Nunez wrote:
> > > My two questions are: Is this summary correct? And: Which method
> > > should I choose?
> > With Java , Python , Perl  you've got functions that
> escapes the data
> > for you
>
> What about C++ and PHP?
>
> Koen
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>


pgsql-general by date:

Previous
From: Koen Vermeer
Date:
Subject: Re: Storing images as BYTEA or large objects
Next
From: Koen Vermeer
Date:
Subject: Re: Storing images as BYTEA or large objects