Files can be uploaded from a browser to the server with forms using the "file" input type. Information about the uploaded files are available in this array.
<form enctype="multipart/form-data" action="upload2.php" method="post">
Upload file: <input name="userfile" type="file">
<input type="submit" value="Upload">
</form>A form is displayed.HTML code for uploading a file. Use together with the next code sample.
<pre>
<?php
print_r($_FILES);
?>
</pre> Array
(
[userfile] => Array
(
[name] => boot.ini
[type] => application/octet-stream
[tmp_name] => \tmp\php878.tmp
[error] => 0
[size] => 193
)
) Prints information about uploaded files.