From the course: PHP Techniques: Working with Files and Directories
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Inspecting uploaded files - PHP Tutorial
From the course: PHP Techniques: Working with Files and Directories
Inspecting uploaded files
- [Instructor] In the previous movie, we learned how to create a basic HTML form that will upload files. In this movie, we'll learn to use PHP to inspect the values that are submitted by that form. PHP has many super globals. You should already know two of them; get and post. PHP has another one for files. That's dollar sign, underscore, and then in all caps, FILES. It's an array of form data submitted using file inputs. Each file input in the form will be an entry that uses the file input name attribute as a key. For example, we used file underscore upload in our last example, so the data would be in the super global for files, and then in square brackets, you would put the string for file underscore upload. What's in that data? It contains another array, and that array has the name, which is the original file name, the type, that's the MIME type, such as image/png, the size of the file being uploaded in bytes,…
Contents
-
-
-
-
-
(Locked)
Configuring PHP for file uploads1m 52s
-
(Locked)
Sending files as form data3m 51s
-
(Locked)
Inspecting uploaded files4m 54s
-
(Locked)
Moving uploaded files5m 7s
-
Handling upload errors4m 2s
-
(Locked)
Setting file permissions6m 7s
-
(Locked)
Securing file uploads2m 15s
-
(Locked)
Challenge: Profile photo3m 48s
-
(Locked)
Solution: Profile photos4m 3s
-
(Locked)
-