PHP is_uploaded_file() Function
Definition
The is_uploaded_file() function checks whether the specified file is uploaded via HTTP POST.
Syntax
PHP is_uploaded_file() Function has the following syntax.
is_uploaded_file(file)
Parameter
Parameter | Is Required | Description |
---|---|---|
file | Required. | File to check |
Return
This function returns TRUE if the file is uploaded via HTTP POST.
Note
The result of this function are cached. Use clearstatcache() to clear the cache.
Example
whether the specified file is uploaded via HTTP POST
<?php/*ww w . j a v a 2s .c o m*/
$file = "test.txt";
if(is_uploaded_file($file)){
echo ("$file is uploaded via HTTP POST");
}else{
echo ("$file is not uploaded via HTTP POST");
}
?>
The code above generates the following result.