Beginner PHP Tutorial - 90 - Uploading Files: Restricting File Extensions Part 1
Loading...
4,885
Loading...
Top Comments
see all
All Comments (7)
-
Yup , There is no need to check the dot :D
-
@CroceMalo1 so we don't need to check the dot? only $type is enough?
-
@lordofthemonths instead of getting the . get the letter after the dot, see if its a j, if not, then continue, and if it is, then check the letter after the j, see if its p, and so on
-
@lordofthemonths $var='image/jpeg'; $type = $_FILES['file']['type']; if ($type==$extn){}else{echo 'Only jpg files only';} this worked very well
-
Why is if($type=='image/jpeg'){} not enough?
Loading...
Thank you, you are a great teacher :D
1zacster 10 months ago 10
what if i upload a file called "some.thing.jpg"
lordofthemonths 9 months ago 2