pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Saving Images
4+ messages / 4 participants
[nested] [flat]

* Saving Images
@ 2001-01-22 15:32 Paul Joseph McGee <mcgee@student.cs.ucc.ie>
  2001-01-22 16:12 ` Re: Saving Images chriswood@wvda.com
  2001-01-22 16:46 ` Re: Saving Images Louis Bertrand <louis@bertrandtech.on.ca>
  2001-01-22 18:28 ` Re: Saving Images Alexandr A. Listopad <laa@laa.zp.ua>
  0 siblings, 3 replies; 4+ messages in thread

From: Paul Joseph McGee @ 2001-01-22 15:32 UTC (permalink / raw)
  To: pgsql-php

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



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Saving Images
  2001-01-22 15:32 Saving Images Paul Joseph McGee <mcgee@student.cs.ucc.ie>
@ 2001-01-22 16:12 ` chriswood@wvda.com
  2 siblings, 0 replies; 4+ messages in thread

From: chriswood@wvda.com @ 2001-01-22 16:12 UTC (permalink / raw)
  To: Paul Joseph McGee <mcgee@student.cs.ucc.ie>; +Cc: 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
--------------------------------------------------------



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Saving Images
  2001-01-22 15:32 Saving Images Paul Joseph McGee <mcgee@student.cs.ucc.ie>
@ 2001-01-22 16:46 ` Louis Bertrand <louis@bertrandtech.on.ca>
  2 siblings, 0 replies; 4+ messages in thread

From: Louis Bertrand @ 2001-01-22 16:46 UTC (permalink / raw)
  To: Paul Joseph McGee <mcgee@student.cs.ucc.ie>; +Cc: pgsql-php

Look at the PHP manual for the pg_lo* functions. They handle PostgreSQL
Large Objects (LO). 

Note that these functions should be performed within a transaction
(BEGIN...COMMIT).

Ciao
 --Louis  <louis@bertrandtech.on.ca> 

On Mon, 22 Jan 2001, 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
> 




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Saving Images
  2001-01-22 15:32 Saving Images Paul Joseph McGee <mcgee@student.cs.ucc.ie>
@ 2001-01-22 18:28 ` Alexandr A. Listopad <laa@laa.zp.ua>
  2 siblings, 0 replies; 4+ messages in thread

From: Alexandr A. Listopad @ 2001-01-22 18:28 UTC (permalink / raw)
  To: Paul Joseph McGee <mcgee@student.cs.ucc.ie>; +Cc: pgsql-php

On Mon, Jan 22, 2001 at 03:32:55PM +0000, 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

Why you want to put images to DB?

why not location to images? -- this save you a lot of disk space and
cpu/mem usage.

-- 
 Laa



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2001-01-22 18:28 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-01-22 15:32 Saving Images Paul Joseph McGee <mcgee@student.cs.ucc.ie>
2001-01-22 16:12 ` chriswood@wvda.com
2001-01-22 16:46 ` Louis Bertrand <louis@bertrandtech.on.ca>
2001-01-22 18:28 ` Alexandr A. Listopad <laa@laa.zp.ua>

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