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.
Sending files as form data - PHP Tutorial
From the course: PHP Techniques: Working with Files and Directories
Sending files as form data
- [Instructor] In this movie, we'll learn how to create an HTML form which is appropriate for uploading files. This is going to be pure HTML. There's no PHP here. This is what a minimum form looks like. It starts with the form tag. It has an action. The page that the form will submit its data to, and then the form method is post because it will be a post request, and then notice that there's an attribute for something called ENC type, which is short for enclosure type. It's value is multipart/form-data. This parameter must be included in any form that's going to upload a file. You don't need it if you're not uploading a file, but if you're uploading a file, you do. It's part of the HTML specification. On the next line, I have an input tag of type file. It includes a name attribute. This is the name that we'll use to reference the uploaded data. You can have more than one of these on a form. You might have…
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)
-