Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id B92F29FA2E9 for ; Mon, 9 Oct 2006 02:28:45 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 55373-05 for ; Mon, 9 Oct 2006 02:28:40 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.183]) by postgresql.org (Postfix) with ESMTP id 9BE809FB381 for ; Mon, 9 Oct 2006 02:28:40 -0300 (ADT) Received: by py-out-1112.google.com with SMTP id m51so2003363pye for ; Sun, 08 Oct 2006 22:28:39 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=RC/9pm4ZAsmjrrfdHo1aykZxSC2LFiM6taUa3tnV3qZl/pbvHqInjNDRRY/7POdFS2ryGmMecMN4Y1iDZpN1xuy/+QjG9d3cVIvQGTHm4/muLT43mjtHqeODJslWeTRjN3DgSe9/2DQ+88opkcQffFt8Xu5sc/TiYPKM2e8+R8I= Received: by 10.65.133.8 with SMTP id k8mr8880758qbn; Sun, 08 Oct 2006 22:28:39 -0700 (PDT) Received: from ?10.1.1.14? ( [203.217.18.65]) by mx.google.com with ESMTP id f18sm2250614qba.2006.10.08.22.28.36; Sun, 08 Oct 2006 22:28:38 -0700 (PDT) Message-ID: <4529DE01.7040003@gmail.com> Date: Mon, 09 Oct 2006 15:28:33 +1000 From: Chris User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: ben wilko CC: pgsql-php@postgresql.org Subject: Re: Tutorial/Example of Insert/Select PDF Postgres DB ? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.452 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, SPF_PASS X-Spam-Level: X-Archive-Number: 200610/8 X-Sequence-Number: 3608 ben wilko wrote: > Hi Guys > > I am looking for an examples on how to insert a PDF file into Postgres > DB and also selecting it so that someone can download it from a page. You would be much better off storing the path to the file (or just the filename) in the database, leaving the file itself on the filesystem and password protecting the downloads folder with a .htaccess file or something. You could then have something like download.php?file=filename.txt and go from there (it would use fpassthru to just spit the file out to the browser etc).. -- Postgresql & php tutorials http://www.designmagick.com/