Hi guys,
I have a site on a domain, let's call it "mydomain.com
", where people can log in.
This domain has a subdomain sub.mydomain.com
.
When the user uploads a file on the main domain, I want to move it to the uploads
folder on sub.mydomain.com
.
The folder I want to move the file to has full write/read privileges.
My code that uploads te file:
$filename = 'background_' . $_SESSION['username'] . '.jpg';
if (is_uploaded_file($_FILES['background']['tmp_name']))
{
move_uploaded_file($_FILES['background']['tmp_name'],
"/var/www/vhosts/mydomain.com/subdomains/sub/httpdocs/uploads/" . $filename);
}
When running this code I get the following warning/error:
Warning: move_uploaded_file() [function.move-uploaded-file]: open_basedir restriction in effect. File(/var/www/vhosts/mydomain.com/subdomains/sub/httpdocs/uploads/background_User.jpg) is not within the allowed path(s): (/var/www/vhosts/mydomain.com/httpdocs:/tmp) in /var/www/vhosts/dezeactie.nl/httpdocs/opmaak.php on line 152
Can anybody enlighten me with a solution for my problem?
One final note: I know I could do the login on the subdomain and upload the file there directly, however I would like to keep the login on the main domain for other purposes.
Thanks in advance.
Jurgen