Beginner PHP Tutorial - 90 - Uploading Files: Restricting File Extensions Part 1

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
4,885
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Apr 20, 2011

Check out the full PHP series at http://www.thenewboston.com/

Here is a link to the phpacademy YouTube Channel. Go and subscribe now!

http://www.youtube.com/user/phpacademy

And here is the phpacademy official website:

http://phpacademy.org/

Category:

Education

Tags:

License:

Standard YouTube License

  • likes, 1 dislikes

Link to this comment:

Share to:

Top Comments

  • Thank you, you are a great teacher :D

  • what if i upload a file called "some.thing.jpg"

see all

All Comments (7)

Sign In or Sign Up now to post a comment!
  • 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...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more