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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Friday, March 23, 2001 5:18 PM
> To: [EMAIL PROTECTED]
> 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
>
> [EMAIL PROTECTED]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]