From the course: PHP Techniques: Working with Files and Directories

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Challenge: Profile photo

Challenge: Profile photo - PHP Tutorial

From the course: PHP Techniques: Working with Files and Directories

Start my 1-month free trial

Challenge: Profile photo

(bright music) - [Instructor] It's time for another challenge assignment. In this challenge, you'll use what we've learned about file uploading to create a real world website feature. Your PHP code shall allow a user to upload a profile photo. You'll create a file upload form, and then a page that will process the form data and upload the file. Once you have a basic working version, try to incorporate some of the techniques and best practices we've learned. Display any upload errors. Validate that the file type is an image file. Make sure that the file size is less than one megabyte or so. Set the file permissions on the uploaded file to allow everyone to read and write the file. And as extra credit, think about how you would customize the file name if you wanted it to be something different than the original file name. You can try this challenge from scratch if you want or you can use the templates that I've added…

Contents