php - How to transfer uploaded image to a directory as well as copy it to another directory

on my project folder there is images/committee/images.jpg . This where the uploaded images are moving to
if(move_uploaded_file($image_temp,"images/committee/".$new_image_name))
Now what m trying to achieve is that.. On the Project folder there is a folder names as
user/images/committee/target.jpg
this where i want to copy the image to.
copy("images/committee/".$new_image_name, "user/images/committee/".$new_image_name);
i tried using this.. but i think m giving wrong path. can some one help
Answer
Solution:
if you use absolute paths you should be OK. ie:copy( __DIR__ . "/images/committee/".$new_image_name, __DIR__ . "/user/images/committee/".$new_image_name );
This worked for me. Do remember to check if you are in right directory if it is not working.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: mysqli::real_connect(): (hy000/2002): connection refused
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.