RE: [PHP] How send a file usig PHP code ?
| From: | ..s.c.o.t.t.. [gts] | Date: | Fri, 23 Mar 2001 22:24:45 +0000 |
| Subject: | RE: [PHP] How send a file usig PHP code ? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-45355@lists.php.net to get a copy of this message | ||
send the proper HTTP headers and then output
the contents of the file.... here's what i
used when i had to prompt the user for a
download box for arbitrary binary files
(.gif, .zip, .png, .pdf)
you might be able to not tell the browser
the size of the data, but it's best to
offer that information if you have it.
print "Content: $filename\r\n";
print "Content-disposition: inline; filename=\"$filename\"\r\n";
print "Content-length: $size\r\n";
print "Content-type: application/octet-stream\r\n";
print "\r\n";
then start outputting the actual data
from the file.zip....
that should work.
> -----Original Message-----
> From: pyramid@pyramid.pl [mailto:pyramid@pyramid.pl]
> Sent: Friday, March 23, 2001 5:18 PM
> To: php-general@lists.php.net
> Subject: [PHP] How send a file usig PHP code ?
>
>
> Hi
>
> I need send to user a file.zip using PHP code.
> Someone have a idea ?
>
> Thx a lot
>
> Krzysztof.Szachun@pyramid.pl
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>