Join David Powers for an in-depth discussion in this video Alerting the user about exceeding the server limits, part of PHP: Uploading Files Securely.
…PHP runs on the web server.…So it can't do very much to prevent users from submitting a…form that attempts to upload files in excess of the server limits.…Its sole protection within the browser is the Max_File_Size hidden…field, which you can see here on line 52 of form.php.…It sets the size limit for individual files.…But there are no checks on the number of files nor…on their combined size until the data is received by the server.…
So what we're going to do, is to create some…custom attributes inside the file input field to store these values.…So let's go back down to the form, and the file input field is here on line 54.…
At the end of this course, you'll have a robust, flexible class that can be incorporated into many projects (including web forms) with just a few lines of code.
- How PHP handles file uploads
- Setting the maximum file size
- Moving the file to its destination
- Creating and using a namespaced class
- Displaying error messages
- Restricting unacceptable MIME types and file extensions
- Using the class
- Reporting errors
- Altering the user
Skill Level Intermediate
1. File-Upload Basics
2. Creating a File-Upload Class
Checking the error level5m 7s
3. Making the Class More Secure
4. Handling Multiple File Uploads
5. Using the Class
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.