Home >> PHP >> How To Get the Uploaded File Information in PHP

How To Get the Uploaded File Information in PHP

HTML

<form name="uploadImage" action="upload.php" method="post" enctype="multipart/form-data">
       <input type="file" name="image">
</form>

PHP

Uploaded file information through the predefined array called $_FILES.

Uploaded file information is organized in $_FILES as a two-dimensional array as:

$_FILES['image']['name'] – The Original file name by the browser.
$_FILES['image']['tmp_name'] – The temporary filename of the file in which the uploaded file was stored on the server.
$_FILES['image']['type'] – The file type determined by the browser.
$_FILES['image']['size'] – The Number of bytes of the file content.
$_FILES['image']['error'] – The error code associated with this file upload.

Post Your Comment

Next Questions
Would I use print "$a dollars" or "{$a} dollars" to print out the amount of dollars
How do you pass a variable by value
How do I find out the number of parameters passed into function
How To Protect Special Characters in Query String
What is the difference between GET and POST
What are the different types of errors
If conditional statement
If else conditional statement
If else / else if conditional statement
Switch conditional statement
For loop
While loop
Do while loop
Foreach loop
Operators
Arithmatic operators
Assignment operators
Increment / Decrement Operators
Comparision Operators
Logical operators
Array Operators
String
addcslashes() function
addslashes() function
chunk_split() function

Copyright ©2022 coderraj.com. All Rights Reserved.