Definition and usage
The move_uploaded_file () function moves the uploaded file to the new location.
If yes, true is returned. Otherwise, false is returned.
Syntax
Move_uploaded_file (file, newloc)
Parameters |
Description |
File |
Required. Specifies the file to be moved. |
Newloc |
Required. Specifies the new location of the file. |
Description
This function checks and ensures thatFileThe specified file is a valid Upload File (that is, it is uploaded through the http post upload mechanism of PHP ). If the file is valid, move itNewlocThe specified file.
IfFileIf the file is not uploaded legally, no operation is performed. move_uploaded_file () returns false.
IfFileIt is a valid file to be uploaded, but it cannot be moved for some reason and no operation will occur. move_uploaded_file () will return false, and a warning will be issued.
This check is especially important. If the uploaded file may display the content to users or other users in the system