X-Original-To: pgsql-php@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id A4D6F474E53 for ; Thu, 30 Jan 2003 17:21:12 -0500 (EST) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by postgresql.org (Postfix) with ESMTP id 4161947763C for ; Thu, 30 Jan 2003 17:21:00 -0500 (EST) Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) by mail1.ihs.com (8.12.6/8.12.6) with ESMTP id h0ULMDoV008031; Thu, 30 Jan 2003 14:22:49 -0700 (MST) Date: Thu, 30 Jan 2003 14:16:39 -0700 (MST) From: "scott.marlowe" To: Adrian Tineo Cc: , Subject: Re: storing images In-Reply-To: <004b01c2c84e$5f31d1e0$f8ddd8d9@supercable.es> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/98 X-Sequence-Number: 1843 On Thu, 30 Jan 2003, Adrian Tineo wrote: > > > >I am searching for tutorials to store and properly display images using > >php-postgresql! > > > >What data type must be the image collumn on my database? > >how can i display the images ? > >how can i control the size of the stored image? > > To include large objects (like images) in the database you need to use > BLOBs, I think the type for postgresql is "bytea". Check the docs. I seem to > remember that you inserted them by means of "lo_import" and extracted them > via "lo_export". > > I am designing an application that needs images (who doesn't?) but I have > decided to store the images separately as usual images (gif, jpg) and store > in the database the link to those images, so I read the link from the > database and the php script loads the image from the link. I don't have any > special requirement for the security of the images, that is, if you knew the > link yourself you could load it in the browser but that is not important. This isn't strictly true anymore. You can now use the bytea type to store binary objects into, but they need to be properly escaped. much easier to manipulate than those pesky large objects.