Page 1 of 1

How to check Image File

Posted: Tue Oct 10, 2006 12:59 am
by eshban
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';
		}

Posted: Tue Oct 10, 2006 2:29 am
by jito
mime_content_type() or getimagesize()