I am trying to get a script to work on a new server. The script was written by someone else, but it doesn't seem to work after I changed to another server.

The script involves the submitting of articles, and uploading of a photo to each article written and submitted.

The written articles are still uploading and displaying fine on the new server, but on the photo part, that must link to the artickle, I get the following error message:
Warning: move_uploaded_file(/public_html/images/photoname.jpg)
[function.move-uploaded-file]: failed to open stream: No such file or directory in /home/*****/public_html/cms/submitimage.php on line 67

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpPitBao' to '/public_html/images/photoname.jpg' in /home/*****/public_html/cms/submitimage.php on line 67 Photo could not be added.

I have checked the script in submitimage.php and on line 67 it says:

if(move_uploaded_file($_FILES, $uploadfile))

and on line 68:

print( "Photo succesfully added!");

I think the part of the script that deals with the uploading is this:


$file_name = $_FILES;

$uploaddir = '/public_html/images/';
$uploadfile = $uploaddir . basename($_FILES);


Can someone please help me to resolve this. I am very novice, and still learning, so excuse my stupidity on this.


Solved, by myself:

The lesson to learn here, is to make sure the path to the upload directory is correct, and the upload folder permissions is correct.

This question has already been answered. Start a new discussion instead.