Received: from wvcn.ns.ca (wvcn.ns.ca [142.176.5.242]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eASHUet60600 for ; Tue, 28 Nov 2000 12:30:40 -0500 (EST) (envelope-from chriswood@wvda.com) Received: from chris (chris.wvcn.ns.ca [142.176.5.243]) by wvcn.ns.ca (8.9.3/8.8.7) with ESMTP id OAA07213 for ; Tue, 28 Nov 2000 14:42:19 -0400 From: chriswood@wvda.com To: pgsql-php@postgresql.org Date: Tue, 28 Nov 2000 13:26:06 -0400 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Question re large objects Message-ID: <3A23B26E.9056.2942B3@localhost> X-mailer: Pegasus Mail for Win32 (v3.12c) X-Archive-Number: 200011/20 X-Sequence-Number: 28 (Hopefully I'm addressing this to the right list... This is my first time with BLOBs anywhere.) I'm working on a web page template system (PHP/PostgreSQL) which will (in part, other stuff is done) allow users to upload a gif or jpeg via a form on another site. The image will then slot into a predetermined place on their template website. I've considered the alternatives (store files in a directory or in the db), and I think storing the image files in the database is the way to go. Unless anybody can think of why I should just upload the files to a directory on the server instead of storing them as BLOBs. I can upload a binary file just fine, and retrieve it from the database just fine. The problem is that the file (using pg_loreadall) just plunks itself into my test page as text/plain. How do I get a mime type header associated with this data so my browser will recognize it as a gif or jpeg? Do I have to export the file to a web-accessible directory (owned by web server user, I know) and then use an tag? Or is there a way to get my browser to recognize that the BLOB is in fact an image when PHP pulls it out of the PostgreSQL database? Be gentle if I've asked a stupid question... :-) -------------------------------------------------------- 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 --------------------------------------------------------