Re: Storing files in postgres db

From: MaXX <bs139412(at)skynet(dot)be>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Storing files in postgres db
Date: 2006-12-04 13:36:48
Message-ID: 20061204143648.70df69d7.bs139412@skynet.be
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 4 Dec 2006 00:28:52 +0800
twxtam(at)gmail(dot)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 and includes. 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 reduce network bandwith if needed...

HTH,
--
MaXX

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Oleg Bartunov 2006-12-04 14:00:52 GiN for 8.1 patch updated
Previous Message Richard Huxton 2006-12-04 13:34:48 Re: Locking for function creation