Re: Saving Images - Mailing list pgsql-php

From chriswood@wvda.com
Subject Re: Saving Images
Date
Msg-id 3A6C2394.15581.10320BA3@localhost
Whole thread Raw
In response to Saving Images  (Paul Joseph McGee <mcgee@student.cs.ucc.ie>)
List pgsql-php
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
--------------------------------------------------------

pgsql-php by date:

Previous
From: Louis Bertrand
Date:
Subject: Re: Saving Images
Next
From: "Alexandr A. Listopad"
Date:
Subject: Re: Saving Images