开发者

Extract attached files from a Sharepoint list

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜