hi, i am a begineer in php, i have written the below code to upload all file type except executable file (.exe file), but whenever i run it in web browser like mozzila it works for me but whenever i try it in google chrome it does not work i mean even .exe files too get uploaded..

upload.php file

echo $fname;
echo $type;
echo "not support";
echo"file is moved";

select.html file
<form method="POST" action="upload.php" enctype="multipart/form-data">
Selectfile:<input name="f1" type="file">
<input type='submit' name='sub' value='upload'>

pls can any body help me with this problem..

Don't rely on the value returned by the $_FILES array because is set by the client, which can be altered or simply different from what expected. For example some executives will return application/x-dosexec.

Use the finfo library:

$finfo  = new finfo(FILEINFO_MIME_TYPE);
$type   = $finfo->file($file);

if(in_array($type, array('mime', 'blacklist')))
    # ... deny ...

Docs: http://php.net/manual/en/function.finfo-file.php