Organize The Files Between Two Domains



I have lots of domain in my DREAMHOST account with same user. For example, I have a photo uploader script in domain. I want that when a photo is uploaded from, I want to move the uploaded file to domain by the script. I tried this command in PHP;

move_uploaded_file($_FILES[“file”][“tmp_name”], “…/{$filename}”);

However it is not success. How can I do this? It is supported?

Thank you,