public static function sanitizeFileName($filename) {
		if (empty($filename)) return "";
		if (function_exists("mb_ereg_replace")) {
			$filename = mb_ereg_replace("([^\w\s\d\-_~,;\[\]\(\).])", '', $filename);
			$filename = mb_ereg_replace("([\.]{2,})", '', $filename);
		} else {
			$filename = preg_replace("([^\w\s\d\-_~,;\[\]\(\).])", '', $filename);
			$filename = preg_replace("([\.]{2,})", '', $filename);
		}
		return $filename;
	}