PHP - How to Upload a File to Your PHP Web Server - HTML Form and PHP Script Tutorial.avi

Опубликовано: 05 Ноябрь 2024
на канале: Help Video Guru
118,210
311

This video shows you how to use PHP to upload a file to your PHP web server.

I start with the HTML form, that prompts the user to browse for a file to upload. Things to watch for:

Use the enctype="multipart/form-data" attribute in your form declaration. If you forget that, nothing will work.

The form action must be the name of the php file that processes the form: action="upload_file.php"

The method should be POST: method="post"

Note that the $_FILES["file"] variable is an array with such goodies as:
error, name, type, size, and tmp_file to access;