The directory must also be real that you are copying the file to, it will not create the directory for you.
You wouldn't have to make us guess what's wrong if you were to show us code.
You wouldn't have to make us guess what's wrong if you were to show us code.