Curriculum
Course: PHP Basic
Login

Curriculum

PHP Basic

PHP Install

0/1

PHP Casting

0/1

PHP Constants

0/1

PHP Magic Constants

0/1

PHP Operators

0/1

PHP Reference

0/276
Text lesson

is_uploaded_file()

Example

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

Definition and Usage

The is_uploaded_file() function determines if an HTTP POST upload of the given file has occurred.

Syntax

is_uploaded_file(file)

Parameter Values

Parameter

Description

file

Essential. gives the location of the file to be checked.

Technical Details

Return Value:

If the file upload fails over HTTP POST, TRUE; otherwise, FALSE

PHP Version:

4.0.3+