Search Postgresql Archives

Re: Storing files in postgres db

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

 



On Mon, 4 Dec 2006 00:28:52 +0800
twxtam@xxxxxxxxx ("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 


[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