Saving Images
Saving Images
От:
Paul Joseph McGee <mcgee@student.cs.ucc.ie>
Дата:
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
Re: Saving Images
От:
Louis Bertrand <louis@bertrandtech.on.ca>
Дата:
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 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 >
Re: Saving Images
От:
chriswood@wvda.com
Дата:
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 --------------------------------------------------------
Re: Saving Images
От:
"Alexandr A. Listopad" <laa@laa.zp.ua>
Дата:
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