Re: DOWNLOAD-SCRIPT ???!!!!!
| From: | Michael Cartmel | Date: | Tue, 21 Nov 2000 01:44:15 +0000 |
| Subject: | Re: DOWNLOAD-SCRIPT ???!!!!! | ||
| References: | 1 2 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-4002@lists.php.net to get a copy of this message | ||
Better way than this is to make a php page that opens a file using fopen,
reads it, then sends an "download" header to force the browser to download.
header("Content-Type: application/download\n");
header("Content-Disposition: attachment; filename=\"<yourfile.tmp>\"");
$fn=fopen("<yourfile.tmp>" , "r");
fpassthru($fn);
Maybe pass the filename in on a query string? (ie.
http://my.site.com/download.php?file=yourfile.tmp)
Then do:
header("Content-Type: application/download\n");
header("Content-Disposition: attachment; filename=\"$file\"");
$fn=fopen($file , "r");
fpassthru($fn);
Cheers, -mic
----- Original Message -----
From: "Ketan" <ketan@seznam.cz>
To: "Serkan" <s.serkan@chello.nl>
Cc: <php-windows@lists.php.net>
Sent: Monday, November 20, 2000 11:13 AM
Subject: Re: [PHP-WIN] DOWNLOAD-SCRIPT ???!!!!!
> If .htm, .php, .txt etc. file is in this link, next page will be
displayed.
> If there is in the link .exe, .zip, .rar - browser automatically returns
dialog window, where you want to save it.
> So, link like this:
> <a href="lins.htm">Take a look for my favourites</a>
> will load page with name "links.htm" and display it.
> And link:
> <a href="archive.zip">Here is my archive</a>
> will open dialog window for saving file "archive.zip" to your disk...
>
> Is it?
> Ketan
>
> *********** Puvodni zprava ***********
>
> Dne 16.10.2000 v 12:55 hodin Serkan napsal(a):
>
> >Hi all...
> >
> >Who can tell me how I can force the browser to download a file when I
click onto a link....
> >
> >Thanxx all
> >
> >~Sire~
>
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> For additional commands, e-mail: php-windows-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net