Search Postgresql Archives

Re: Storing images as BYTEA or large objects

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

 



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@xxxxxxxxxxxxxx 
> [mailto:pgsql-general-owner@xxxxxxxxxxxxxx] On Behalf Of Koen Vermeer
> Sent: Wednesday, February 13, 2008 9:43 AM
> To: pgsql-general@xxxxxxxxxxxxxx
> Subject: Re:  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
> 


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux