note 31240 deleted from function.header by sniper

From: Date: Sun, 07 Sep 2003 21:41:45 +0000
Subject: note 31240 deleted from function.header by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-55644@lists.php.net to get a copy of this message
Note Submitter: matmoss@club-internet.fr ---- 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

« previous php.notes (#55644) next »