note 31240 added to function.header
| From: | matmoss at club-internet dot fr | Date: | Tue, 15 Apr 2003 03:37:37 +0000 |
| Subject: | note 31240 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-46620@lists.php.net to get a copy of this message | ||
Sending a file - mp3 for instance - using header statement, it seems windows/msie (6.0..)
doesn't care about mime type sent using header("Content-Type: $mime_type") statement
but rather guess the type of the file from the file extension in the
header("Content-Disposition: attachment; filename=$filename") statement.
Therefore one must absolutely specify an extension in order to have the file correctly handled by
the browser and the dedicated application for that type of file, else the shell will ask for
choosing an application to handle this file type. In an other hand netscape navigator seems to take
into account the mime type provided in the header information whatever extension the file has. if no
header("Content-Type: $mime_type") is specified netscape will not handle the file,
displaying it as is in the browser while msie will handle it correctly as long as the file extension
is provided.
In conclusion you've got to set carefully the mime-type and the filename extension in order to
have your fie be handled the way you want in both browser.
cheers
--
http://www.php.net/manual/en/function.header.php
http://master.php.net/manage/user-notes.php?action=edit+31240
http://master.php.net/manage/user-notes.php?action=delete+31240
http://master.php.net/manage/user-notes.php?action=reject+31240