protected function _checkFileUpload( $filename, $errcode )
	{
		if( is_uploaded_file( $filename ) === false ) {
			throw new Controller_ExtJS_Exception( 'File was not uploaded' );
		}

		switch( $errcode )
		{
			case UPLOAD_ERR_OK:
				break;
			case UPLOAD_ERR_INI_SIZE:
			case UPLOAD_ERR_FORM_SIZE:
				throw new Controller_ExtJS_Exception( 'The uploaded file exceeds the max. allowed filesize' );
			case UPLOAD_ERR_PARTIAL:
				throw new Controller_ExtJS_Exception( 'The uploaded file was only partially uploaded' );
			case UPLOAD_ERR_NO_FILE:
				throw new Controller_ExtJS_Exception( 'No file was uploaded' );
			case UPLOAD_ERR_NO_TMP_DIR:
				throw new Controller_ExtJS_Exception( 'Temporary folder is missing' );
			case UPLOAD_ERR_CANT_WRITE:
				throw new Controller_ExtJS_Exception( 'Failed to write file to disk' );
			case UPLOAD_ERR_EXTENSION:
				throw new Controller_ExtJS_Exception( 'File upload stopped by extension' );
			default:
				throw new Controller_ExtJS_Exception( 'Unknown upload error' );
		}
	}
protected function _checkFileUpload( $filename, $errcode )
	{
		if( is_uploaded_file( $filename ) === false ) {
			throw new Controller_ExtJS_Exception( 'File was not uploaded' );
		}

		switch( $errcode )
		{
			case UPLOAD_ERR_OK:
				break;
			case UPLOAD_ERR_INI_SIZE:
			case UPLOAD_ERR_FORM_SIZE:
				throw new Controller_ExtJS_Exception( 'The uploaded file exceeds the max. allowed filesize' );
			case UPLOAD_ERR_PARTIAL:
				throw new Controller_ExtJS_Exception( 'The uploaded file was only partially uploaded' );
			case UPLOAD_ERR_NO_FILE:
				throw new Controller_ExtJS_Exception( 'No file was uploaded' );
			case UPLOAD_ERR_NO_TMP_DIR:
				throw new Controller_ExtJS_Exception( 'Temporary folder is missing' );
			case UPLOAD_ERR_CANT_WRITE:
				throw new Controller_ExtJS_Exception( 'Failed to write file to disk' );
			case UPLOAD_ERR_EXTENSION:
				throw new Controller_ExtJS_Exception( 'File upload stopped by extension' );
			default:
				throw new Controller_ExtJS_Exception( 'Unknown upload error' );
		}
	}
protected function _checkFileUpload ( $ filename , $ errcode ) { if ( is_uploaded_file ( $ filename ) === false ) { throw new Controller_ExtJS_Exception ( 'File was not uploaded' ) ; } switch ( $ errcode ) { case UPLOAD_ERR_OK : break ; case UPLOAD_ERR_INI_SIZE : case UPLOAD_ERR_FORM_SIZE : throw new Controller_ExtJS_Exception ( 'The uploaded file exceeds the max. allowed filesize' ) ; case UPLOAD_ERR_PARTIAL : throw new Controller_ExtJS_Exception ( 'The uploaded file was only partially uploaded' ) ; case UPLOAD_ERR_NO_FILE : throw new Controller_ExtJS_Exception ( 'No file was uploaded' ) ; case UPLOAD_ERR_NO_TMP_DIR : throw new Controller_ExtJS_Exception ( 'Temporary folder is missing' ) ; case UPLOAD_ERR_CANT_WRITE : throw new Controller_ExtJS_Exception ( 'Failed to write file to disk' ) ; case UPLOAD_ERR_EXTENSION : throw new Controller_ExtJS_Exception ( 'File upload stopped by extension' ) ; default : throw new Controller_ExtJS_Exception ( 'Unknown upload error' ) ; } }
Checks if the file is a valid uploaded file

@param string $filename Path to the file that should be checked
@param integer $errcode Error code from file upload
@throws Controller_ExtJS_Exception If file upload isn't valid or the error code represents an error state
Checks if the file is a valid uploaded file