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
  • Change file owner chown

    chown

    Changefileowner
  • Return the target of the symbolic link readlink

    readlink

    Returnthetargetofthe
  • Get file type filetype

    filetype

    Getfiletype
  • Read a line from a file pointer and filter out HTML tags fgetss

    fgetss

    Readalinefromafilepo
  • Change the current umask umask

    umask

    Changethecurrentumas
  • Check if the file or directory exists file_exists

    file_exists

    Checkifthefileordire
  • Rewind the file pointer position rewind

    rewind

    Rewindthefilepointer
  • Close process file pointer pclose

    pclose

    Closeprocessfilepoin
Popular Articles