Try our conversational search powered by Generative AI!

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
Sep 08, 2006 13:25
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.