Home > PHP > Function > Filesystem > is_uploaded_file()

is_uploaded_file()

is_uploaded_file - Tells whether the file was uploaded via HTTP POST

Syntax

bool is_uploaded_file (string $filename)

Arguments

  • filename - The filename being checked.

Description

Returns TRUE if the file named by filename was uploaded via HTTP POST. This is useful to help ensure that a malicious user hasn't tried to trick the script into working on files upon which it should not be working--for instance, /etc/passwd.

Version

PHP 4.0.3, 5

Return value

Returns TRUE on success or FALSE on failure.