The is_uploaded_file() function checks whether the specified file is uploaded via HTTP POST.
PHP is_uploaded_file() Function has the following syntax.
is_uploaded_file(file)
Parameter | Is Required | Description |
---|---|---|
file | Required. | File to check |
This function returns TRUE if the file is uploaded via HTTP POST.
The result of this function are cached. Use clearstatcache() to clear the cache.
whether the specified file is uploaded via HTTP POST
<?php
$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.