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

		if( is_uploaded_file( $filename ) === false ) {
			throw new \Aimeos\Controller\ExtJS\Exception( 'File was not uploaded' );
		}
	}