如何将上传的一个图像存储到父目录和子目录

I have two directory company model branch model both have upload folder

$name = $_FILES["file"]["name"];
// here its working
move_uploaded_file(
  $_FILES["file"]["tmp_name"],
  "upload/" . $name
);


move_uploaded_file(
    $_FILES["file"]["tmp_name"],
    "branch model/upload/" . $name
);

Use copy()

 $target_path = "upload/";
 $target_path2 = "branch model/upload/";

move_uploaded_file($_FILES['file']['tmp_name'], $target_path.$name);
        copy($target_path.$name, $target_path_2.$name);