PHP is_uploaded_file() Function

❮ PHP Filesystem Reference

Example

Check whether the specified filename 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 output of the code above could be:

test.txt is not uploaded via HTTP POST


Definition and Usage

The is_uploaded_file() function checks whether the specified file is uploaded via HTTP POST.

Syntax

is_uploaded_file(file)

Parameter Values

Parameter Description
file Required. Specifies the path to the file to check


Technical Details

Return Value: TRUE if the file is uploaded via HTTP POST, FALSE on failure
PHP Version: 4.0.3+

❮ PHP Filesystem Reference
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.