bbrunning
asked on
php upload script not working
Here's the code I put in my index.php file:
<?php
if(isset($_FILES['upload'] ))
{
if(move_uploaded_file($_FI LES['uploa d']['tmp_n ame'], "/var/www/virtual/globalso urcingintl .com/uploa d/htdocs/u ploads/$_F ILES[uploa d]['name]" ))
echo "File uploaded successfully";
else echo "Problem uploading file";
}
?>
<form action="" method="post" enctype="multipart/form-da ta">
<p>Select file to upload<input type="file" name="upload" /></p>
<input type="submit" value="Upload" />
</form>
I cannot get this to work. This is a dedicated server running ubuntu, I have 2 domains and a subdomain. The subdomain is where the upload script is: upload.globalsourcingintl. com. The absolute path to the upload directory is /var/www/virtual/globalsou rcingintl. com/upload /htdocs/up loads/
But that's the path when I'm logged in as root under ssh. Everytime I try to upload something I get the else error.
Another thing: I have the subdomains main directory protected using .htaccess and .htpasswd, I am logged in before actually trying to upload the files.
Any Ideas?
<?php
if(isset($_FILES['upload']
{
if(move_uploaded_file($_FI
echo "File uploaded successfully";
else echo "Problem uploading file";
}
?>
<form action="" method="post" enctype="multipart/form-da
<p>Select file to upload<input type="file" name="upload" /></p>
<input type="submit" value="Upload" />
</form>
I cannot get this to work. This is a dedicated server running ubuntu, I have 2 domains and a subdomain. The subdomain is where the upload script is: upload.globalsourcingintl.
But that's the path when I'm logged in as root under ssh. Everytime I try to upload something I get the else error.
Another thing: I have the subdomains main directory protected using .htaccess and .htpasswd, I am logged in before actually trying to upload the files.
Any Ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
nvm, I guess in the hectic problems I was having I deleted and recreated the directory when I was messing around and accidentally forgot to chmod 777 again. You were right.
Thanks
Thanks
ASKER