Forum Moderators: coopster
function uploadFile($filePostName,$uploadDir){
$uploadDirSafe = "./".$uploadDir;
$uploadDir = "".PHPBACE."".$uploadDir;
if($this->testUploadDir($uploadDir)){
$ourFileName = $_FILES[$filePostName]['name'];
if(move_uploaded_file($_FILES[$filePostName]['tmp_name'], $uploadDir."".$ourFileName)){
return $uploadDirSafe."".$ourFileName;
} else { $this->_error .= "<br />FILE UPLOAD:: no file"; return false; }
} else { $this->_error .= "<br />FILE UPLOAD:: upload dir not found -".$uploadDir; return false;}
}
$file = $this->uploadFile('ourfile','./userfiles/');
It's returning the error no file... which is winding me up because testUploadDir is not failing, so it has write permissions and it can find the dir...and I am testing $_FILES before I try and upload I know its there...please help!
have you verified that the image gets copied to the server? actually look in the folder it is supposed to be in, should still be there if it didn't get moved
can you verify, if it was uploaded, that the filename was exact?
it could also be a relative/absolute path issue
is it an uppercase/lowercase issue from going from a windows server to a *nix server?
these are all usual suspects for upload issues.