PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
eshban
Forum Contributor
Posts: 184 Joined: Mon Sep 05, 2005 1:38 am
Post
by eshban » 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
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';
}
jito
Forum Commoner
Posts: 85 Joined: Sat Mar 25, 2006 4:32 am
Location: india
Post
by jito » Tue Oct 10, 2006 2:29 am
mime_content_type() or getimagesize()