Page 1 of 1

file type detection in php

Posted: Thu Oct 23, 2008 3:46 am
by susrisha
I have a page which enables the uploading of files..(basically images of format .jpg, .gif and .png). while uploading a png file in internet explorer(IE) i am getting the file type as 'image/x-png' and in other browsers, it only shows the file type as 'image/png'.
can someone tell me why this difference when the same file is uploaded through different browsers??

Code: Select all

 
$type = $_FILES["file"]["type"];
echo $type;
 
 
Response from IE : image/x-png
Response from FireFox: image/png

why is the difference??

Re: file type detection in php

Posted: Thu Oct 23, 2008 5:34 am
by onion2k
susrisha wrote:why is the difference??
Because Microsoft don't stick to standards.