Verify if the given filename has been uploaded using 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 code above might produce is:
test.txt is not uploaded via HTTP POST |
The is_uploaded_file() function determines if an HTTP POST upload of the given file has occurred.
is_uploaded_file(file) |
Parameter |
Description |
file |
Essential. gives the location of the file to be checked. |
Return Value: |
If the file upload fails over HTTP POST, TRUE; otherwise, FALSE |
PHP Version: |
4.0.3+ |