Monday, November 8, 2010

Download the Sharepoint List Attachment

You can download the attachment from the any SharePoint List to your local drive in your Server using the following code. Based on the article from Microsoft "How to Programmatically Download attachment from list items in WSS" i iterate the list item and also i checked for Exist of attachment for each list item.

Inherited Web-part Class and create the button control and attach the click event, in the "CreateChildControls" method as below code

(Click on above image to Enlarge the Image)

Now write the code to download the attachment from the List as below in the Button Click event Method

(Click on above image to Enlarge the Image)

Now you create a custom web-part for download the attachment of the list. Create Strong key and build the class deploy it in your Server and update the Web.Config. Add it in web-part gallery and edit the page select the web-part to download attachment. that it. When you click on the web-part, it will automatically download all attachment to the specified path.


Source :Kethare.in

No comments:

Post a Comment