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

Unlock the full course today

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

Inspecting uploaded files

Inspecting uploaded files - PHP Tutorial

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

Start my 1-month free trial

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