Re: Database and files
| From: | Danny Shepherd | Date: | Mon, 22 Apr 2002 10:25:45 +0000 |
| Subject: | Re: Database and files | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-93962@lists.php.net to get a copy of this message | ||
----- Original Message -----
From: "David Russell" <davidr@execulink.co.za>
To: <php-general@lists.php.net>
Sent: Monday, April 22, 2002 11:19 AM
Subject: [PHP] Database and files
> I have a database. It receives from my users files - which could be word
> documents, Adobe PDF files, text docs, anything...
>
> I store these in a BLOB field of the database.
>
If you get multiple requests for files, expect the db to fall over very
quickly - what's wrong with storing them on the filesystem and having a list
of them in the db?
[SNIP]
> Finds out the attachment mime type
>
> Sends a:
>
> Header("Content-type: <mime-type>");
> Header("Header("Content-Disposition: attachment;
filename=\"File65.doc\"" );
> Stream the contents of the blob to the browser.
>
WTF is up with Header("Header(" ??
Surely this should be Header("Content-Disposition: attachment;
filename=\"File65.doc\"" );
Here's how I do it
header("content-type: $mime");
header("content-disposition: attachment; filename=\"$displayName\"");
echo $data;
One thing - note that that the header names and the actual mimetype are in
lower case. Got weird results with anything different.
HTH
Danny