PHP is_uploaded_file() Function
In this chapter you will learn:
- Definition for PHP is_uploaded_file() Function
- Syntax for PHP is_uploaded_file() Function
- Parameter for PHP is_uploaded_file() Function
- Return for PHP is_uploaded_file() Function
- Note for PHP is_uploaded_file() Function
- Example - whether the specified file is uploaded via HTTP POST
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//from j a v a2 s .c om
$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.
Next chapter...
What you will learn in the next chapter:
- Definition for PHP is_writable() Function
- Syntax for PHP is_writable() Function
- Parameter for PHP is_writable() Function
- Return for PHP is_writable() Function
- Note on PHP is_writable() Function
- Example - checks whether the specified file is writeable
Home » PHP Tutorial » PHP File Functions