Re: MIME Downloads
| From: | David Robley | Date: | Wed, 30 Apr 2003 09:04:01 +0000 |
| Subject: | Re: MIME Downloads | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-145737@lists.php.net to get a copy of this message | ||
In article <001301c30ec3$3ca2a710$4500a8c0@theplague>, jtx@hatesville.com
says...
> Trying to allow users to download database queries in various formats,
> such as pdf, excel, and csv. I have all the script created that take
> the query results and format the data for each of the formats, but the
> problem I'm having now is actually delivering the file when people want
> to download it. There is no physical file on the server they are
> downloading. The file is basically just stored in a variable.
>
> So, say I have the variable $results, which contains an encoded PDF
> file, and I want the person to download it... I'm assuming it would be
> something like
>
> header('Cache-Control: no-cache, must-revalidate');
> header('Pragma: no-cache');
> header("Content-type: application/pdf");
>
> After this though, I'm stuck. How to I finish this part off here? Every
> example I've seen so far assumes the file exists on the server. Thanks!
Have you tried
echo $var;
--
Quod subigo farinam