note 19091 added to features.file-upload
| From: | yogi at darkmag dot net | Date: | Fri, 15 Feb 2002 13:52:18 +0000 |
| Subject: | note 19091 added to features.file-upload | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-26645@lists.php.net to get a copy of this message | ||
There's a strange issue with file uploading and mime types, it seems it depends of the
browser..
With a file upload system, the above code will show differents results :
echo "type : ".$HTTP_POST_FILES["image"]["type"]." name :
".$HTTP_POST_FILES["image_thb"]["name"]." tmpname :
".$HTTP_POST_FILES["image"]["tmp_name"]." size :
".$HTTP_POST_FILES["image"]["size"] ;
where 'image' is an input (type='file') field.
On IE, it gives :
type : image/pjpeg name : apercuclip.jpg tmpname : /tmp/phpwYQzWO size : 5182
Ok, normal, let's try another
On Netscape6 it gives :
type : image/jpeg name : apercuclip.jpg tmpname : /tmp/php6jgmQR size : 5182
note that the mime type is now image/jpeg and not image/pjpeg
On Opera6 :
type : image/jpeg; name=\"apercuclip.jpg\" name : apercuclip.jpg tmpname : /tmp/php655KLf
size : 5182
Still image/jpeg, but there's also a "name" value ! weird result..
So be careful with that while uploading file..
--
http://www.php.net/manual/en/features.file-upload.php
http://master.php.net/manage/user-notes.php?action=edit+19091
http://master.php.net/manage/user-notes.php?action=delete+19091
http://master.php.net/manage/user-notes.php?action=reject+19091