Loading...
PHP

Files in PHP

$_FILE:
By using this super global variable we can get the information of uploaded files. It is two dimensional array variable contains five elements. Each element’s first dimension is name of upload control.
If user is uploaded a file from browser to server or the file transfer to server. In temporary memory location stores with another name. We have to implement PHP code to move that file from temporary memory location to the permanent memory location.

  1. $_FILE is used to tell some information about uploaded files.
  2. $_FILES[‘name of upload file’] [‘name’]
    By using this element we can get uploaded file name
  3. $_FILES[‘name of upload file’] [‘size]
    By using this file we can get uploaded file size
  4. $_FILES[‘name of upload file’] [‘error’]
    To get the error if any occurred in the time of uploading the file
  5. $_FILE[‘name of upload file’] [‘type’]
    To get the MIME type of uploaded file
  6. $_FILES[‘name of upload file’] [‘tmp_name’]
    To get temporary location file name.
Leave a Reply

Your email address will not be published. Required fields are marked *