Sunday, February 2, 2014

InfoPath form to upload an image to SharePoint (no code)

InfoPath SharePoint integration can be implemented in several ways. You can integrate InfoPath 2010 with SharePoint 2010 through SharePoint web services, SharePoint workflows, SharePoint event handlers, or by writing code in InfoPath forms that makes use of the SharePoint client object model or the SharePoint server object model.
Where the two latter means of integration are concerned, you will always have to give your form Full Trust to be able to call those two object models.
If you do not want to write code to integrate InfoPath with SharePoint, your best bet is to explore what theSharePoint web services have got to offer.
Where the uploading of images are concerned, you can either write code to upload images to SharePoint document or picture libraries, or you can use one of two web services: 
1. SharePoint Copy web service, or 
2. SharePoint Imaging web service without having to write code.
Both SharePoint web services offer similar functionality, however, the Imaging web service can be used to upload an image to a SharePoint picture library, while the Copy web service can be used to upload an image to any SharePoint document library.
In addition, if you want to create an InfoPath form that can upload one image to a library, you do not have to write code to get such functionality, and you can use either the Copy web service or the Imaging web service to do so.
Because the Copy web service is a bit more involved than the Imaging web service, this article shows you how to use the Imaging web service to upload an image from an InfoPath form to SharePoint. However, the same techniques you use for hooking up the Imaging web service to an InfoPath form using an InfoPath data connection and rules, would apply to the Copy web service.


In the following 4-minute InfoPath 2010 tutorial video, I show you how easy it is to use rules to connect an InfoPath form to SharePoint's Imaging web service to be able to upload an image to a SharePoint picture library using an InfoPath browser form or Filler form.

No comments: