November Happy Hour will be moved to Thursday December 5th.
protected string GetFileTitle(string filePath, AccessLevel accessLevel) { UnifiedFile file = UnifiedFileSystem.GetFile(filePath, accessLevel); string fileName = file.Name; string fileExtension = file.Extension; string fileDescription = String.Empty; string fileSizeFormatted; string userSpecifiedFileName = String.Empty; if (file.Summary.Title != null) { userSpecifiedFileName = file.Summary.Title; } if (file.Length == 1) { fileSizeFormatted = file.Length.ToString() + "byte"; } else if (file.Length > 1 && file.Length < 1024) { fileSizeFormatted = file.Length.ToString() + "bytes"; } else if (file.Length < (1024 * 1024)) { fileSizeFormatted = (file.Length / 1024) + "KB"; } else { fileSizeFormatted = (file.Length / (1024*1024)) + "MB"; } fileDescription = "(" + fileExtension.Replace(".", String.Empty).ToUpper() + " " + fileSizeFormatted + ")"; if (userSpecifiedFileName.Trim().Length > 0) { return userSpecifiedFileName + " " + fileDescription; } else { return fileName.Replace(fileExtension, String.Empty) + " " + fileDescription; } }
protected string GetFileTitle(string filePath, AccessLevel accessLevel) { UnifiedFile file = UnifiedFileSystem.GetFile(filePath, accessLevel); string fileName = file.Name; string fileExtension = file.Extension; string fileDescription = String.Empty; string fileSizeFormatted; string userSpecifiedFileName = String.Empty; if (file.Summary.Title != null) { userSpecifiedFileName = file.Summary.Title; } if (file.Length == 1) { fileSizeFormatted = file.Length.ToString() + "byte"; } else if (file.Length > 1 && file.Length < 1024) { fileSizeFormatted = file.Length.ToString() + "bytes"; } else if (file.Length < (1024 * 1024)) { fileSizeFormatted = (file.Length / 1024) + "KB"; } else { fileSizeFormatted = (file.Length / (1024*1024)) + "MB"; } fileDescription = "(" + fileExtension.Replace(".", String.Empty).ToUpper() + " " + fileSizeFormatted + ")"; if (userSpecifiedFileName.Trim().Length > 0) { return userSpecifiedFileName + " " + fileDescription; } else { return fileName.Replace(fileExtension, String.Empty) + " " + fileDescription; } }