Women in Technology

Hear us Roar



Article:
  Working with Forms in PHP, Part 2
Subject:   Upload fails but no errors
Date:   2004-11-11 03:36:16
From:   TeranteK
I am making an upload module for mambo and I have the following code incorporated into the file, but it will not upload the file, despite there being no errors:
$file_name = $_FILES['userfile']['name'];


$path = $mosconfig_live_site + "/uploads/" + $file_name; /** $mosconfig_live_site: this line gets the url of the site */


$uploadfile = $path . $_FILES['userfile']['name'];


if(move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {


/** carries out rest of functions */


}else{
echo "Your file could not be uploaded";
}


I keep getting the error shown above but when I turn on error checking, no reason is displayed. If anybody could help me with this it would be much appreciated.