Join David Powers for an in-depth discussion in this video Limitations on file uploads, part of PHP: Uploading Files Securely.
…File uploads are controlled by several PHP configuration directives.…So it's a good idea to run phpinfo…to see what limitations apply to your server's setup.…I've got phpinfo in this file here, so let's just run it in a browser.…And these are the configuration settings for my server.…All the directives that relate to uploads are in the Core section close to the top.…So let's just scroll down…to find it. Here's the Core section.…And the most important directive for file uploads is called file_uploads.…
It's this one here.…And of course, it goes without saying, that…this must be on for file uploads to work.…The other directives so spread out in different parts of this core list.…So to make it easier to focus, I've listed them all together.…Both file_uploads and…upload_tmp_dir can be changed only by the…server administrator in the main server configuration files.…upload_tmp_dir controls where upload files…are stored temporarily before being processed.…
This normally defaults to the server's main temporary directory.…
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.