Difference between copy and move_uploaded_file

what's the difference between copy () and move_uploaded_file ()

I think that both functions perform the same operations, and then what's the difference?

copy ( $_FILES['file']['tmp_name'], 
     "C:/Apache/htdocs/" . $_FILES['file']['name'] ) 


move_uploaded_file($_FILES['file']['tmp_name'], 
     "C:/Apache/htdocs/" . $_FILES['file']['name'])
+5
source share
2 answers

This function checks that the file indicated by the file name is a valid download file (this means that it was downloaded via the PHP HTTP POST upload mechanism). If the file is valid, it will be moved to the file name specified by the destination.

Such a check is especially important if there is a possibility that everything that is done with the downloaded files can show their contents to the user or even other users on the same system.

http://php.net/manual/en/function.move-uploaded-file.php

, , move_uploaded_file() FALSE.

+10

, .

, , () .

, (: $_FILES) .

+1

All Articles