Hi,I have seen a few posts regarding this but non seem to help, i'm trying to pull a few details from the File API.File type I.E. pdf, doc, jpgThe file size.Iv'e added a method in my CMSTransformation class. It's can't find the AttachmentManager, CurrentDocument, ValidationHelper extension methods. Iv'e added the code for attachment size below:public static string GetAttachmentSize(object fileAttachmentGuidId)
{
// Get current attachment GUID
Guid attachGuid = CMS.GlobalHelper.ValidationHelper.GetGuid(fileAttachmentGuidId, Guid.Empty);
if (attachGuid != Guid.Empty)
{
// Get the attachment
AttachmentManager am = new AttachmentManager();
AttachmentInfo ai = am.GetAttachmentInfo(attachGuid, CMSContext.CurrentSite.SiteName);
if (ai != null)
{
string attExtension = ai.AttachmentExtension;
return DataHelper.FileSizeFormat(ai.AttachmentSize);
}
}
return string.Empty;
}
I can't find any examples for the file type, has anyone done this before?Thank you,
Conor
↧