SEE ALSO PHP PAGE ON FILE UPLOADS: https://ibex.tech/cloud/php/forms/post-file-uploads

Including 1 or more files to be uploaded in a form

The data encoding type enctype MUST be specified as “multipart/form-data”:

<form enctype="multipart/form-data" action="__URL__" method="POST">

You can include one or more files like this:

    <input type="hidden" name="MAX_FILE_SIZE" value="30000" />    MAX_FILE_SIZE must precede the file input field
    <label>Send this file</label>
    <input name="file_uploaded1" type="file" />

Handling in PHP

//----- HANDLE THE FILE UPLOADS -----
//Delete any existing files
unlink("/var/www/html/files/ca.pem");
//Move the uploaded file from the temporary directory it was uploaded to
echo '<pre>';
if (move_uploaded_file($_FILES['file_uploaded1']['tmp_name'], "/var/www/html/files/ca.pem"))
{
    echo "File is valid, and was successfully uploaded.\n";
}
else
{
    echo "Possible file upload attack!\n";
}
echo 'Here is some more debugging info:';
print_r($_FILES);
print "</pre>";