public function doUpload() {
        $result = false;
        
        if(is_array($this->fileArray['tmp_name'])) {
        	error_log('file array is in multi upload format, use doMultiUpload()');
        	return false;
        }
        
        $errno = $this->fileArray['error']; 
		if($errno == UPLOAD_ERR_OK) {

			if(!File::createFolder($this->uploadDir,true)) {
	        	error_log('Failed to create directory ' . $this->uploadDir);
	        	return false;
	        }
			
			if(is_uploaded_file($this->fileArray['tmp_name'])) {
				$result = move_uploaded_file($this->fileArray['tmp_name'], $this->uploadDir.$this->fileArray['name']);
			} else {
				$result = copy($this->fileArray['tmp_name'], $this->uploadDir.$this->fileArray['name']);
			}
			
			if($result) {
				$this->uploaded[] = $this->fileArray;
			
				//can't rely on browser to determine mime type, so do our own check.
				$this->setMimeType($this->uploadDir.$this->fileArray['name']);
			}
		} else {
			error_log($this->getErrMsg($errno));    
			$result = false;
		}
        
        return $result;
    }
public function doUpload() {
        $result = false;
        
        if(is_array($this->fileArray['tmp_name'])) {
        	error_log('file array is in multi upload format, use doMultiUpload()');
        	return false;
        }
        
        $errno = $this->fileArray['error']; 
		if($errno == UPLOAD_ERR_OK) {

			if(!File::createFolder($this->uploadDir,true)) {
	        	error_log('Failed to create directory ' . $this->uploadDir);
	        	return false;
	        }
			
			if(is_uploaded_file($this->fileArray['tmp_name'])) {
				$result = move_uploaded_file($this->fileArray['tmp_name'], $this->uploadDir.$this->fileArray['name']);
			} else {
				$result = copy($this->fileArray['tmp_name'], $this->uploadDir.$this->fileArray['name']);
			}
			
			if($result) {
				$this->uploaded[] = $this->fileArray;
			
				//can't rely on browser to determine mime type, so do our own check.
				$this->setMimeType($this->uploadDir.$this->fileArray['name']);
			}
		} else {
			error_log($this->getErrMsg($errno));    
			$result = false;
		}
        
        return $result;
    }
public function doUpload ( ) { $ result = false ; if ( is_array ( $ this -> fileArray [ 'tmp_name' ] ) ) { error_log ( 'file array is in multi upload format, use doMultiUpload()' ) ; return false ; } $ errno = $ this -> fileArray [ 'error' ] ; if ( $ errno == UPLOAD_ERR_OK ) { if ( ! File :: createFolder ( $ this -> uploadDir , true ) ) { error_log ( 'Failed to create directory ' . $ this -> uploadDir ) ; return false ; } if ( is_uploaded_file ( $ this -> fileArray [ 'tmp_name' ] ) ) { $ result = move_uploaded_file ( $ this -> fileArray [ 'tmp_name' ] , $ this -> uploadDir . $ this -> fileArray [ 'name' ] ) ; } else { $ result = copy ( $ this -> fileArray [ 'tmp_name' ] , $ this -> uploadDir . $ this -> fileArray [ 'name' ] ) ; } if ( $ result ) { $ this -> uploaded [ ] = $ this -> fileArray ; //can't rely on browser to determine mime type, so do our own check. $ this -> setMimeType ( $ this -> uploadDir . $ this -> fileArray [ 'name' ] ) ; } } else { error_log ( $ this -> getErrMsg ( $ errno ) ) ; $ result = false ; } return $ result ; }
the uploaded file should have been uploaded to a temp dir
move the file to the target directory

@return boolean
the uploaded file should have been uploaded to a temp dir move the file to the target directory