[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    Re: [GENERAL] storing files in postgres
From:       "Joshua D. Drake" <jd () commandprompt ! com>
Date:       2005-03-31 17:44:07
Message-ID: 1112291047.30190.4.camel () jd2 ! commandprompt ! com
[Download RAW message or body]

On Thu, 2005-03-31 at 12:03 -0500, Bob Powell wrote:
> -->  
> Hello everyone, 
>  
> I have created a table as follows: 
>  
> CREATE TABLE document ( 
> image_id int, 
> image bytea 
> ); 
>  
> I want to insert a complete file, let's say an open office document
> into this table.  Anyone know how I would doe this? 

You need to use the bytea functions allocated to your language API.
Which language are you using for this?


>  
> Then if I can get the document into the image field, how would I
> retrieve it to display it in my HTML document?   

When you say "display" what do you mean? An open office sxw document
is not going to display in an html document. You can link to it or
have it stream to launch an external application though.

Sincerely,

Joshua D. Drake




>  
> Thanks in advance. 
> 
> Bob Powell
> Database Administrator
> 
-- 
Command Prompt, Inc., Your PostgreSQL solutions company. 503-667-4564
Custom programming, 24x7 support, managed services, and hosting
Open Source Authors: plPHP, pgManage, Co-Authors: plPerlNG
Reliable replication, Mammoth Replicator - http://www.commandprompt.com/


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic