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
  • Modify the owner of the symbolic link lchown

    lchown

    Modifytheownerofthes
  • Read a line from the file pointer and parse the CSV field fgetcsv

    fgetcsv

    Readalinefromthefile
  • All remaining data at the output file pointer fpassthru

    fpassthru

    Allremainingdataatth
  • Create a temporary file tmpfile

    tmpfile

    Createatemporaryfile
  • Get file information through the opened file pointer fstat

    fstat

    Getfileinformationth
  • Positioning in file pointer fseek

    fseek

    Positioninginfilepoi
  • Write to files (safely used in binary files) fwrite

    fwrite

    Writetofiles(safelyu
  • Determine whether the file is uploaded through HTTP POST is_uploaded_file

    is_uploaded_file

    Determinewhetherthef
Popular Articles