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
  • Set file access and modification time touch

    touch

    Setfileaccessandmodi
  • Read the entire file into an array file

    file

    Readtheentirefileint
  • Return the target of the symbolic link readlink

    readlink

    Returnthetargetofthe
  • Get the last access time of the file fileatime

    fileatime

    Getthelastaccesstime
  • Change file owner chown

    chown

    Changefileowner
  • Check if the file or directory exists file_exists

    file_exists

    Checkifthefileordire
  • All remaining data at the output file pointer fpassthru

    fpassthru

    Allremainingdataatth
  • Read a line from a file pointer fgets

    fgets

    Readalinefromafilepo
Popular Articles