public static function getMaxUploadFileSize($localLimit = 0) {
			// don't allow more than the global max file size at all
		$t3Limit = (intval($localLimit > 0 ? $localLimit : $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize']));
			// as TYPO3 is handling the file size in KB, multiply by 1024 to get bytes
		$t3Limit = $t3Limit * 1024;

			// check for PHP restrictions of the maximum size of one of the $_FILES
		$phpUploadLimit = self::getBytesFromSizeMeasurement(ini_get('upload_max_filesize'));
			// check for PHP restrictions of the maximum $_POST size
		$phpPostLimit = self::getBytesFromSizeMeasurement(ini_get('post_max_size'));
			// if the total amount of post data is smaller (!) than the upload_max_filesize directive,
			// then this is the real limit in PHP
		$phpUploadLimit = ($phpPostLimit < $phpUploadLimit ? $phpPostLimit : $phpUploadLimit);

			// is the allowed PHP limit (upload_max_filesize) lower than the TYPO3 limit?, also: revert back to KB
		return floor($phpUploadLimit < $t3Limit ? $phpUploadLimit : $t3Limit) / 1024;
	}