Get attachments in SharePoint custom list Pragmatically
I want to get Attachments based on SPQuery, the following code will help you to get the attachments.
SPLIobjItems = Customlist.GetItems(spqueryobj);
foreach (SPListItem SPLIobj in SPLIobjItems )
{
foreach (String attachmentname in SPLIobj .Attachments)
{
//Based on SPLIobj getting attachments
String attachmentURL = SPLIobj .Attachments.UrlPrefix + attachmentname;
attchedvalue = attachmentURL ;
}
}
}
No comments:
Post a Comment