$fileType=$_FILES['dosya']['type'];
switch($fileType){
case "image/jpeg" :$typeResult="A";
break;
case "image/gif" :$typeResult="B";
break;
case "image/png" :$typeResult="C";
break;
case "application/pdf" :$typeResult="D";
break;
case "application/msword" :$typeResult="E";
break;
case "text/plain" :$typeResult="F";
break;
default :$typeResult="hata";
//php ile sadece bu dosya tipleriyse değer döndürüyordum bunlardan biri değilse hata olarak dönüyor sende bu şekilde yapabilirsin
}