I'm learning about the file uploading in php. For that I referred some links. In that they said inside the upload code we have to use:
move_uploaded_file(upload_file_name, 'path to move')
function for move the file to our desired directory.
But in move_uploaded_file
function they pass the temp name as a first argument.
Why they are using the temp name as a first argument? Why not they used original name?
move_uploaded_file($_FILES['photo']['tmp_name'], 'uploads/'.$new_file_name);
Why we have to use this temp_name? Is there any reasons available for that?