بهذه الطريقة يتم التحقق :
كود PHP:
$ftype= $_FILES['filup']['type'];
$allowed_extensions = array (
"image/pjpeg",
"image/gif",
"image/x-png",
"application/x-zip-compressed"
);
if ((!in_array( $ftype , $allowed_extensions )) ) {
$err= "نوع الملف الأصلي <br><font color=red>$ftype</font><br>غير مصرح به";
}
يمكنك الاطلاع على مصدر السكريبت والتعلم منه
[سكريبت] مركز التحميل النسخة 7.1 تم التحديث - دعم السكريبتات والأكواد
تحياتي