Re: How to secure a download ?
| From: | Alex Earl | Date: | Sat, 31 May 2003 18:04:08 +0000 |
| Subject: | Re: How to secure a download ? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-149660@lists.php.net to get a copy of this message | ||
> header("Content-type: application/zip");
> header("Content-Disposition: attachment; filename=yourfilename.zip");
> readfile("/path/to/yourfilename.zip");
>
I have found that to make sure it works with all browsers you want to put
quotes around the filename in the content-disposition header.
header( "Content-tpye: application/zip" );
header( "Content-Disposition: attachment; filename=\"yourfile.zip\" );
readfile( "/path/to/yourfilname.zip" );
the reason I say this is because without the quotes, some browsers insert
a "[1]" or something similar without them.
Alex