public static string GetMaterialFileNameByExtName(string extName) { if (!extName.StartsWith(".")) { extName = "." + extName; } return($"{StringUtils.GetShortGuid(false)}{extName}"); }
public static string GetSafeFilename(string filename) { if (string.IsNullOrEmpty(filename)) { return(StringUtils.ToLower(StringUtils.GetShortGuid())); } return(string.Join("_", filename.Split(GetInvalidChars()))); }
public static string GetUploadFileName(string filePath, bool isUploadChangeFileName) { if (isUploadChangeFileName) { return($"{StringUtils.GetShortGuid(false)}{GetExtension(filePath)}"); } var fileName = GetFileNameWithoutExtension(filePath); fileName = GetSafeFilename(fileName); return($"{fileName}{GetExtension(filePath)}"); }
public static string GetMaterialFileName(string filePath) { return($"{StringUtils.GetShortGuid(false)}{GetExtension(filePath)}"); }