RE: [PHP] Downloads
| From: | Warren Vail | Date: | Thu, 17 Oct 2002 19:30:58 +0000 |
| Subject: | RE: [PHP] Downloads | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-120387@lists.php.net to get a copy of this message | ||
Try <a href="mydoc.php">Click here to download</a>
mydoc.php begins by outputting file download headers
then can place data into a meaningful form with echo statements sending text
into the downloaded file.
see the manual at http://www.php.net/manual/en/function.header.php
for example to create a downloadable pdf file
header("Content-type: application/pdf");
header("Content-Disposition: attachment; filename=downloaded.pdf");
followed by outputting your content.
You might also want to understand that downloading/uploading is a function
of http, and not necessarily the underlying language, unless, of course, you
are referring to the ftp kind of upload/download (there is a whole suite of
ftp functions available for that as well)
good luck,
Warren Vail
-----Original Message-----
From: Chris Boget [mailto:chris@wild.net]
Sent: Thursday, October 17, 2002 12:00 PM
To: 1LT John W. Holmes; php-general@lists.php.net
Subject: Re: [PHP] Downloads
> > > > I know that php allows uploading , but does it support downloading.
> > > Yes, it does.
> > > <a href="mydocument.doc">Click here to download</a>
> > That's HTML. not PHP ;-)
> You are correct, I apologize.
> echo "<a href='mydocument.doc'>Click here to download</a>";
My god, that's got to be the funniest thing I've read all day!
Thanks for the laugh, John. :p
Chris
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php