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
  • Read a line from a file pointer and filter out HTML tags fgetss

    fgetss

    Readalinefromafilepo
  • Output file readfile

    readfile

    Outputfile
  • Determine whether the given file name is a symbolic connection is_link

    is_link

    Determinewhethertheg
  • Establish symbolic connection symlink

    symlink

    Establishsymboliccon
  • Clear file status cache clearstatcache

    clearstatcache

    Clearfilestatuscache
  • Modify the owner of the symbolic link lchown

    lchown

    Modifytheownerofthes
  • Give information about a file or symbol connection lstat

    lstat

    Giveinformationabout
  • Change the group to which the file belongs chgrp

    chgrp

    Changethegrouptowhic
Popular Articles