pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chris <dmagick@gmail.com>
To: ben wilko <wilko_ben@hotmail.com>
Cc: pgsql-php@postgresql.org
Subject: Re: Tutorial/Example of Insert/Select PDF Postgres DB ?
Date: Mon, 09 Oct 2006 15:28:33 +1000
Message-ID: <4529DE01.7040003@gmail.com> (raw)
In-Reply-To: <BAY116-F25AFCFF446476194CE5DC88F160@phx.gbl>
References: <BAY116-F25AFCFF446476194CE5DC88F160@phx.gbl>

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/



view thread (4+ messages)  latest in thread

Message-ID: <4529DE01.7040003@gmail.com>
Permalink:  ../4529DE01.7040003@gmail.com/
Also on:    postgresql.org/message-id/4529DE01.7040003@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: dmagick@gmail.com, wilko_ben@hotmail.com
  Subject: Re: Tutorial/Example of Insert/Select PDF Postgres DB ?
  In-Reply-To: <4529DE01.7040003@gmail.com>
  References: <BAY116-F25AFCFF446476194CE5DC88F160@phx.gbl> <4529DE01.7040003@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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