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

ParameterIs RequiredDescription
fileRequired.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.





















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions