Programmatically Estrazzjoni Attachments minn forom InfoPath (InkluŜ l-ismijiet!)

I have an expense entry solution for a client that leverages InfoPath and workflow. At one point during the approval process, I bżonn li jiġġeneraw email li tkun kollha ta 'dik data InfoPath tajba kif ukoll l-annessi nnifishom sabiex (daqqa) xi ħadd jista 'jieħu dik id-data u manwalment mill-ġdid muftieħ f'applikazzjoni database Oracle.

It’s not very difficult to get at or parse the InfoPath form. I didn’t know how to handle the attachments, madankollu. After an hour or two of poking around the Internets (eternity!) Sibt dan l-artikolu: http://support.microsoft.com/kb/892730

It provide some handy code to extract the attachment from a node in the form. (Inti xorta jkollok bżonn biex isibu l-node u dak kollu li, iżda li biss parsing XML).

I know that the attachment is base64-encoded and I originally went down the path of just extracting the the base64 data, decoding it and saving it. Madankollu, I quickly realized I didn’t know how to get the file name itself until I found the aforementioned article.

I had actually found that quite early, but I was put off by its split personality. On the one hand, the article *says* it’s good for InfoPath 2007. Madankollu, the code and instructions are all about Visual Studio 2003 and references to InfoPath 2003.

Bottom line, the code that article provided is working well for me (s'issa). I can get my InfoPath form, I can parse it, I can find and decode the attachment and I know its name. What more can one ask of one’s life?

</aħħar>

Abbona għall-blog tiegħi.

Follow lili Twitter fi http://www.twitter.com/pagalvin

Jekk int inkwetat li l-ambjent SharePoint tiegħek jista 'jkun tad ħżiena għas-saħħa, let me jgħinuk jiffissaw dak ma 'kontroll tas-saħħa.

Ħalli Irrispondi

Your email address mhux se jkun ippubblikat. Meħtieġa oqsma huma mmarkati *