Page 1 of 1

move_uploaded_file fails on yahoo servers, works on godaddy

Posted: Sat Mar 12, 2011 1:10 am
by D33L15H
USING PHP 5---->
I have this piece of code that takes a few images off a form, and uploads them to the root folder /images/tour/

It works fine if I upload it to godaddy on another account I have and the images show up as they should in ftp, but no matter what I do on the yahoo server, including granting 777 access to every folder, including the tmp folder, on the server doesn't fix the issue, and the images don't upload.

I have also tried changing the file folder to "/images/tour", putting the script in the root folder and running it as "images/tour".

When I run this script it prints out the root folder, and the temp folder as being "/" for root, and temp as "/tmp"... I'm at a loss...

Here is the code from the form... And I ran the following commented out code and it shows the form is doing it's job correctly:

//echo "<pre>";
//print_r($_FILES);
//echo "</pre>";


if ($_FILES["imgfile2"]["error"] > 0)
{
echo "Return Code: " . $_FILES["imgfile2"]["error"] . "<br />";
}
else
{
echo "Upload: " . $_FILES["imgfile2"]["name"] . "<br />";
echo "Type: " . $_FILES["imgfile2"]["type"] . "<br />";
echo "Size: " . ($_FILES["imgfile2"]["size"] / 1024) . " Kb<br />";
echo "Temp file: " . $_FILES["imgfile2"]["tmp_name"] . "<br />";
move_uploaded_file($_FILES["imgfile2"]["tmp_name"], "..images/tour/" . $_FILES["imgfile2"]["name"]);
echo "Stored in: " . "..images/tour/" . $_FILES["imgfile2"]["name"];
}

Re: move_uploaded_file fails on yahoo servers, works on goda

Posted: Sat Mar 12, 2011 1:15 am
by D33L15H
It shows the file upload as the following, so you know that i'm not hitting the 8mb cap on uploads or anything like that.

Upload: artists.jpg
Type: image/jpeg
Size: 516.6337890625 Kb
Temp file: /tmp/phpqMZILw
Stored in: ..images/tour/artists.jpg