How to check Image File
Posted: Tue Oct 10, 2006 12:59 am
Hi,
can anybody tell me that how i can check my browse file extension.
i want to upload only image files . If any one give any other file eg .zip then it shows the message
'File not suppport' etc.
i am doing like this
can anybody tell me that how i can check my browse file extension.
i want to upload only image files . If any one give any other file eg .zip then it shows the message
'File not suppport' etc.
i am doing like this
Code: Select all
$image = $_REQUEST['image1'];
$d = explode(".", $image);
if($d[1] <> 'jpg' || $d[1] <> 'jpeg' || $d[1] <> 'gif' || $d[1] <> 'png'){
print 'File cannot be uploaded';
}