O'Reilly logo

InfoPath with SharePoint® 2013 How-To by Steven Mann

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix B. Upload File Attachments in Forms to a Document Library

This appendix presents a code-behind method that uploads an attached file to a separate document library when the form is submitted. The code here was adapted from Pranab Paul’s blog on MSDN.

Form Scenario

The form used in this scenario contains a file attachment control with a field named fileAttach. There is also a button to be used as a submit button with and ID of SubmitButton.

The user may upload a file to the form and then submit the form. There is a form library in SharePoint to which to submit the InfoPath form instance, but there is also a document library in which the file attached to the form needs to be uploaded. A data connection for submission has been created ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required