Current Location: Home> Function Categories> move_uploaded_file

move_uploaded_file

Move uploaded files to a new location
Name:move_uploaded_file
Category:File system
Programming Language:php
One-line Description:Move the uploaded file to a new location.

Definition and usage

The move_uploaded_file() function moves the uploaded file to a new location.

Return true if successful, otherwise return false.

grammar

 move_uploaded_file ( file , newloc )
parameter describe
file Required. Specify the files to be moved.
newloc Required. Specify the new location of the document.

illustrate

This function checks and ensures that the file specified by the file is a legal upload file (that is, uploaded through PHP's HTTP POST upload mechanism). If the file is legal, move it to the file specified by newloc .

If the file is not a legal upload file and no operation occurs, move_uploaded_file() will return false.

If the file is a legal upload file, but cannot be moved for some reason and no action occurs, move_uploaded_file() will return false, and a warning will be issued.

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
  • Create a hard connection link

    link

    Createahardconnectio
  • Returns the normalized absolute path name realpath

    realpath

    Returnsthenormalized
  • Read files (safely used in binary files) fread

    fread

    Readfiles(safelyused
  • Returns the file path information pathinfo

    pathinfo

    Returnsthefilepathin
  • Get file size filesize

    filesize

    Getfilesize
  • Change the current umask umask

    umask

    Changethecurrentumas
  • Delete directory rmdir

    rmdir

    Deletedirectory
  • Get the last access time of the file fileatime

    fileatime

    Getthelastaccesstime
Popular Articles