Re: Storing files in postgres db - Mailing list pgsql-general

From MaXX
Subject Re: Storing files in postgres db
Date
Msg-id 20061204143648.70df69d7.bs139412@skynet.be
Whole thread Raw
In response to Storing files in postgres db  ("tam wei" <twxtam@gmail.com>)
List pgsql-general
On Mon, 4 Dec 2006 00:28:52 +0800
twxtam@gmail.com ("tam wei") wrote:

> Dear all,
>
> I am intending to store the files inside the postgres DB using the
> type text (all the files will be pre-encode into base64. The reason
> for not using the type bytea as I encountered some undesired
> format(the original file alignment can't be preserved) while
> extracting the content and display iit using php).
Hi,

Make sure you don't have any unwanted caracters before or after the php tags (<? ?> or <?php ?>) in your main script
andincludes. Php will output them, thus breaking your file. 
A more robust workaround is using output buffering to clear any unwanted output before sending the file...

I have no problem storing bytea objects and retreiving them. Using output buffering allows you to use ob_gzhandler to
reducenetwork bandwith if needed...  

HTH,
--
MaXX

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Locking for function creation
Next
From: Oleg Bartunov
Date:
Subject: GiN for 8.1 patch updated