php move uploaded file
snippet in php

php move uploaded file

user2811

move_uploaded_file ( string $filename , string $destination ) : bool

move uploaded file in php

user2665

<?php
   if (move_uploaded_file($_FILES['userfile']['tmp_name'], "/documents/new/")) {
      print "Uploaded successfully!";
   } else {
      print "Upload failed!";
   }
?>

php move_uploaded_file

user7916

$upload_folder = "upload/";
$file_location = $upload_folder . basename($_FILES["fileToUpload"]["name"]);

     if(isset($_FILES['fileToUpload'])){ 

        if(move_uploaded_file($_FILES['fileToUpload']['tmp_name'], $file_location)){
            
            echo 'Files has uploaded'; 
        };

     } 

php move file

user5369

//Use the rename() function.
rename('first_location/image1.jpg', 'new_location/image1.jpg');

move uploaded file in php

user6547

move_uploaded_file(file_path, moved_path)