2011年9月20日 星期二

SharePoint 2007: Display Attachment List


Display file links:

foreach (String fileAtt in attachmentsAtt)
{
          String attachmentAbsoluteURL =
          item.Attachments.UrlPrefix // gets the containing directory URL
          + fileAtt;
   // Add ToDo here
}


Get SPFile from Attachment:
SPAttachmentCollection attachmentsAtt = item.Attachments;
 foreach (String fileAtt in attachmentsAtt)
{
             SPFile file = web.GetFile(attachmentsAtt.UrlPrefix + fileAtt);
             // Add ToDo here
}


沒有留言:

張貼留言