Current Location: Home> Function Categories> is_uploaded_file

is_uploaded_file

Determine whether the file is uploaded through HTTP POST
Name:is_uploaded_file
Category:File system
Programming Language:php
One-line Description:Determine whether the file is uploaded through HTTP POST.

Definition and usage

is_uploaded_file() function determines whether the specified file is uploaded through 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");
  }
?>

输出:

test.txt is not uploaded via HTTP POST

grammar

 is_uploaded_file ( file )
parameter describe
file Required. Specify documents to be inspected.

illustrate

Return TRUE if the file given by the file is uploaded via HTTP POST.

This function can be used to ensure that malicious users cannot trick scripts into accessing files that are not accessible, such as /etc/passwd.

This kind of check is particularly important if the uploaded file may cause the content to be displayed to the user or other users of the system.

Similar Functions
Popular Articles