note 19091 deleted from features.file-upload by didou
| From: | didou@php.net | Date: | Mon, 23 Jun 2003 11:46:36 +0000 |
| Subject: | note 19091 deleted from features.file-upload by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-50855@lists.php.net to get a copy of this message | ||
Note Submitter: yogi@darkmag.net
----
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..