Retrieve uploaded file information using PHP
When a file upload form posts the file to a Web server, the called PHP script specified in the form action attribute is used to process the file. This receiving PHP script can get the uploaded file information through the predefined array called $_FILES. Uploaded file information is organized in $_FILES as a two-dimensional array as:
$_FILES[$field]['name'] – The Original file name on the browser system.
$_FILES[$field]['type'] – The file type determined by the browser.
$_FILES[$field]['size'] – The Number of bytes of the file content.
$_FILES[$field]['tmp_name'] – The temporary filename of the file in which the uploaded file was stored on the server.
$_FILES[$field]['error'] – The error code associated with this file upload.
The $field is the name used in the tag.
Filed Under: PHP File Handling