Extract attachment from Infopath form in SP 2013

I need to be able to extract an attachment from an InfoPath form and I am happy to have it go to another document library. I have found the following article but this relates to 2007 and I need it for 2013 - http://www.bizsupportonline.net/infopath2007/use-workflow-extract-file-attachment-infopath-upload-sharepoint-document-library.htm

Will this work for 2013?  If not, I'd appreciate some direction on how to do this.  I have no coding experience but I am happy to give it a go if there are some clear instructions.


December 4th, 2014 5:11pm

Try this 


As far as I know, there isn't anything built into either SharePoint or InfoPath to do this; you would have to write code. Take a look at this article http://support.microsoft.com/kb/892730 for how to decode the base64 encoded string of an attachment. If you're using VB.NET, you can take a look at this InfoPath newsgroup threadhttp://groups.google.com/group/microsoft.public.infopath/browse_thread/thread/310fca090e9f708f/81376114cd5ee732?hl=en&lnk=gst&q=attachment+disk+infopath#81376114cd5ee732


Once you've decoded the attachment, you can use either the WebClient class (if you're extracting from outside of SharePoint) or classes of the SharePoint Object Model (if you're extracting from somewhere inside of SharePoint) to upload the binary data as a file to a SharePoint document library.


There are several ways to retrieve the form and extract the attachment; it all depends on your requirements and at which moment you want to do the extraction. You could use for example an ItemAdded event handler in SharePoint on the form library to do the extraction as soon as the form has been added to the form library. You could also extract after the fact by creating a utility program (outside of SharePoint) that would retrieve all forms in a form library and do the extraction.

Free Windows Admin Tool Kit Click here and download it now
December 5th, 2014 5:25am

We had faced the same scenario. We created a web service call from the info path from.

From the info path we give stream to web service. (WCF)

In the WCF Client service we used the SharePont Client side object model and upload the stream to sharepoint document libraray.

December 5th, 2014 6:29am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics