public function setUploadDir($dir)
    {
        // Check to see if the upload directory exists.
        if (!file_exists($dir) || !is_dir($dir)) {
            $this->error = self::UPLOAD_ERR_DIR_NOT_EXIST;
        // Check to see if the permissions are set correctly.
        } else if (!is_writable($dir)) {
            $this->error = self::UPLOAD_ERR_DIR_NOT_WRITABLE;
        }

        $this->uploadDir = $dir;
        return $this;
    }
public function setUploadDir($dir)
    {
        // Check to see if the upload directory exists.
        if (!file_exists($dir) || !is_dir($dir)) {
            $this->error = self::UPLOAD_ERR_DIR_NOT_EXIST;
        // Check to see if the permissions are set correctly.
        } else if (!is_writable($dir)) {
            $this->error = self::UPLOAD_ERR_DIR_NOT_WRITABLE;
        }

        $this->uploadDir = $dir;
        return $this;
    }
public function setUploadDir ( $ dir ) { // Check to see if the upload directory exists. if ( ! file_exists ( $ dir ) || ! is_dir ( $ dir ) ) { $ this -> error = self :: UPLOAD_ERR_DIR_NOT_EXIST ; // Check to see if the permissions are set correctly. } else if ( ! is_writable ( $ dir ) ) { $ this -> error = self :: UPLOAD_ERR_DIR_NOT_WRITABLE ; } $ this -> uploadDir = $ dir ; return $ this ; }
Set the upload directory

@param  string $dir
@return Upload
Set the upload directory