Get attachments in SharePoint custom list Programatically

Advertisement

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 ;
                             }
                        }
Advertisements
SHARE

Lakshmi Tulasi Jasti

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment