note 40989 added to function.header
| From: | blaxpear at hotmail dot com | Date: | Thu, 25 Mar 2004 17:59:53 +0000 |
| Subject: | note 40989 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-67173@lists.php.net to get a copy of this message | ||
When trying to download a Binary from MySQL via the browser, Mozilla will add an extra
'.php' extention to the fileName. [installer.exe.php -- instead of -- installer.exe]
A simple workaround or patch I found was by passing the fileName in the download URL. For example:
http://www.mydomain.com/download.php?installer.exe
Instead of simply using:
http://www.mydomain.com/download.php
Don't forget to use the appropriate headers too;
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="installer.exe"');
Have fun!... :-)
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40989
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40989&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40989&report=yes
Search -- http://master.php.net/manage/user-notes.php