开发者

Extract attached files from a Sharepoint list

开发者 https://www.devze.com 2023-02-18 01:03 出处:网络
Is there a way to extract all the attached files in a SharePoint lis开发者_StackOverflow中文版t?You can loop through each list item, and get each attachment.

Is there a way to extract all the attached files in a SharePoint lis开发者_StackOverflow中文版t?


You can loop through each list item, and get each attachment.

List<SPAttachment> attachments = new List<SPAttachment>();
SPList list = SPContext.Current.Web.Lists["My List"];

foreach (SPListItem item in list.Items)
{
    attachments.AddRange(item.Attachments.Cast<SPAttachment>());
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号