pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: chriswood@wvda.com
To: Paul Joseph McGee <mcgee@student.cs.ucc.ie>
Cc: pgsql-php@postgresql.org
Subject: Re: Saving Images
Date: Mon, 22 Jan 2001 12:12:04 -0400
Message-ID: <3A6C2394.15581.10320BA3@localhost> (raw)
In-Reply-To: <200101221532.PAA23420@student.cs.ucc.ie>

Note that earlier I had managed to decipher this question, and 
asked this list how to retrieve my image as an image, instead as 
just any old binary file. The answer to that one is that you need to 
add an http content-type header to the file when retrieved from the 
database for it to display as an image. The dwellers in this list also 
pointed out to me that it's better (in Apache, anyway) to store the 
image just in the file system and then reference the path and file 
name somewhere in the database.

However, if you still want to store the actual image in the database, 
you should read up on the filesystem and Postgres large object 
functions in the PHP manual:

http://php.net/manual/en/ref.pgsql.php
(scroll down for pg_lo* functions)

http://php.net/manual/en/ref.filesystem.php
(for important things to do with your uploaded file after it's copied to 
the db)

Handling file uploads:
http://php.net/manual/en/features.file-upload.php

Hope this helps, if not, pester me further.

On 22 Jan 2001, at 15:32, Paul Joseph McGee wrote:

> hi, 
> i was just wondering how to go about saving an image in my PostgreSQL
> database. all i seem to find is the same page which doesnt describe at all
> well how to do it.
> Thanks,
> Paul
> 



--------------------------------------------------------
Christopher Wood, Community Access Technical Coordinator
Western Valley Development Authority
Nova Scotia's Smart Community
Box 251 Bridgetown, Nova Scotia  B0S 1C0
tel: (902) 665-4083/ fax: (902) 665-2878
www.wvda.com www.wvcn.ns.ca
--------------------------------------------------------



view thread (4+ messages)  latest in thread

Message-ID: <3A6C2394.15581.10320BA3@localhost>
Permalink:  ../3A6C2394.15581.10320BA3@localhost/
Also on:    postgresql.org/message-id/3A6C2394.15581.10320BA3@localhost

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: chriswood@wvda.com, mcgee@student.cs.ucc.ie
  Subject: Re: Saving Images
  In-Reply-To: <3A6C2394.15581.10320BA3@localhost>
  References: <200101221532.PAA23420@student.cs.ucc.ie> <3A6C2394.15581.10320BA3@localhost>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox