The is_uploaded_file() function checks whether the specified file was uploaded via HTTP POST.
This function returns TRUE if the file was uploaded via HTTP POST.
is_uploaded_file(file)
parameter | describe |
---|---|
file | Required. Specifies the documents to be checked. |
Note: The results of this function will be cached. Please use clearstatcache() to clear the cache.
<?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 above code will output:
test.txt is not uploaded via HTTP POST