InfoPath Attachment Linking - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

InfoPath Attachment Linking

Downloads: 6,802 File Size: 18.2kB
Posted By: Patrick Halstead Views: 18,069
Date Added: 06-15-2008

NOTE: Qdabra.com now has a package called qRules, available by clicking this link (or clicking DOWNLOAD above).  In it you'll find the ability to upload both file and image attachments.

This solution shows how you can copy InfoPath attachments to SharePoint document library and convert the Base64 string attachment in your InfoPath form into a link to the uploaded SharePoint document. Follow the steps below to see how the solution works.

1. Download the Solution Pack by clicking on the link above.

2. Extract the contents of the ImageAttachments.zip file to your local folder. For the purposes of this example, extract the contents to C:\ drive. The sample InfoPath Form source files would then be located in this folder: C:\ImageAttachments\Attachment\InfoPath Form Template.

3. Open ViewOptions.xml in a text editor such as notepad. You will need to modify the URL to point to your SharePoint site's document library. Save ViewOptions.xml.

4. Right-click on manifest.xsf, and select Design. Preview your form. InfoPath will look for the related Visual Basic or C# code file, if prompted, click on Browse.

5. Browse to C:\ImageAttachments\Attachment\Attachment.csproj.

6. Test the form in Preview mode by attaching a sample file. You will notice that a link to the uploaded SharePoint document will be created under the Attachment Link column. Clicking this link will open the uploaded document/file, and in your SharePoint document library, you will see a list of all the documents you have uploaded.

Note: this sample solution uses the taskpane to upload and convert the image attachments to SharePoint documents. This means that the form cannot be used in the browser.

Comments

 

kranthipv said:

I tried to run the sample but got an error ([Object Error]) with a dialog box. Can you please tell me if I need to change any settings other than changing URL in ViewOptions.xml Thans, Kiran
11-17-2008 09:08 AM
 

Hilary Stoupa said:

You shouldn't need to change anything besides the URL in the ViewOptions.xml. The library needs to be one you have access to. Can you provide more information on the error?
12-11-2008 08:26 AM
 

akash_waits said:

I did as the instructions are provided just changed the ViewOptions.xml but It is not working and i am getting same error ([Object Error]) with a dialog box . Actually the methods to submit data to sharepoint in the Util.cs file are never called. And in my case i am submitting a form to a different server so i need to provide credentials. How to do that? Regarding the error detail a simple dialog box appears with "[Object Error]" written in it and that arises after DecodeAttachment method returns decodedAttachment variable in FormCode.cs file. Please tell me what is the solution for this. Thanks, Akash Kansal.
12-16-2008 02:02 AM
 

akash_waits said:

Actually I just noticed that the exception is coming while creating XMLHttp object in tpRouting.htm file. What should i do to solve that?
12-16-2008 04:08 AM
 

ddyess said:

Can you give an example of how to use the save file using qrules? I assume it is the SaveFilesToDocLib command
02-03-2009 07:59 AM
 

buck_murdock said:

I have my own form (Software Purchase Requests) that submits a good amount of information to a Sharepoint list (using a lot of C#). In my form i want to be able to have an attachment control so that a user can attach a price quote. I havent found a way to actually submit the attachment to the "Attachment" column in the sharepoint list. Would I be able to attach this code into my own form so that at least a price quote can be submitted to a document library so our purchaser can view that quote? If so how. i've tried on my own several times to add the code from this example into my own form, but can't seem to get it to work. Any help is appreciated!!! Thanks!
02-18-2009 04:11 PM
 

SJohnson said:

I have also tried this but ge the same error message as above - 'Object Error'. Any ideas appreciated. Also is this code available in vb.net?
02-25-2009 03:04 AM
 

Patrick Halstead said:

This example needs updating because it doesn't support browser forms (the InfoPath Forms Services in MOSS 2007 doesn't support taskpanes or image controls). We have a new free package called qRules that contains better support for uploading images to SharePoint and replacing with links (click on my name above to read more). To make qRules work for browser-enabled forms, you'll want to use a file attachment and attach the image as a file attachment and use qRules to convert the image into a link that way. Also note that you will need to activate any solution that uses qRules. We plan to post more on this topic in the near future.
03-04-2009 06:20 PM
 

DaFlea said:

Is this still an active topic. I was trying download the sample but there is an error when doing so.
04-20-2009 11:06 AM
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.