----- Original Message -----
From: "David Russell" <[EMAIL PROTECTED]>
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?


> 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.



PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to