I place 2 very easy functions within my transformation like so:
<script runat="server">
public CMS.DocumentEngine.AttachmentInfo ai;
public string GetFileSize()
{
string returnValue = "";
ai = CMS.DocumentEngine.AttachmentInfoProvider.GetAttachmentInfo(ValidationHelper.GetGuid(Eval("FileAttachment"), Guid.Empty), CMS.SiteProvider.SiteContext.CurrentSiteName);
if (ai != null)
{
returnValue = String.Format("{0} {1}", ai.AttachmentSize / 1024, " KB");
}
return returnValue;
}
public string GetFileExtension()
{
string returnValue = "PDF";
if (ai != null)
{
returnValue = ai.AttachmentExtension.Replace(".", "").ToUpper();
}
return returnValue;
}
</script>
Then in my transformation, I call those functions like so:
<tr>
<td><%# Eval("FileFullName") %></td>
<td><%# Eval("FileName") %></td>
<td><%# GetFileExtension() %></td>
<td><%# GetFileSize() %></td>
</tr>
Which returns something like this: