Cannot read UnifiedFile.Summary.Title with AccessControlList.NoAccess...

Vote:
 
Using the function below I am able to get all top level properties from a unifiedfile (e.g. Name, Path, Extension), but I am unable to access any of the properties below Summary (e.g. Title, Author) Any ideas anyone? Cheers in advance 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; } }
#12767
Mar 25, 2008 18:35