开发者

programatically add attachment in custom list in sharepoint 2010

开发者 https://www.devze.com 2023-02-15 19:09 出处:网络
i have registered ItemAttachmentAdded in my custom lis开发者_运维问答t.can anyone send me some code how can i add attachment in custom list.Google told me how to do it:

i have registered ItemAttachmentAdded in my custom lis开发者_运维问答t.can anyone send me some code how can i add attachment in custom list.


Google told me how to do it:

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spattachmentcollection.add.aspx

byte[] fileData = GetFileData();
SPContext.Current.Web.Lists["My List"].Items[0].Attachments.Add("filename", fileData)
0

精彩评论

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

关注公众号