In this article, you will learn about IS_UPLOADED_FILE method in PHP. The is_uploaded_file() function in PHP checks whether the specified file is uploaded via HTTP POST.
what is the syntax of the is_uploaded_file function in php?
is_uploaded_file(file)
Parameter | Description |
---|---|
file | Required. Specifies the path to the file to check |
examples of the is_uploaded_file function
Example 1. In this example, we 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");
}
?>