Skip to main content
Nintex Community Menu Bar

Retrieving the filename of the attached document in K2 from an InfoPath form with attached document

  • January 27, 2008
  • 3 replies
  • 20 views

Forum|alt.badge.img+7

I've managed to upload the document to a sharepoint document library retrieving the attachment as a K2 field, and this works a treat, however, I don't know the filename of the document i've just uploaded... or do I.


Most of the infopath forums suggest writing code to decode the unicode attachment to retrieve the filename, I was wondering if this was possible in K2 before I go hacking code behind InfoPath


Martin

3 replies

Forum|alt.badge.img+7
  • Author
  • January 28, 2008

if anyone is interested I managed to get around this issue by adding some code behind the infopath form to decode the attachment to get the filename.


I can post the code here if anyone wants it


Martin


Forum|alt.badge.img+9
  • January 28, 2008
Post it!  I'm sure others will find it useful.  Though I have to ask, when you uploaded the document to SharePoint, didn't you get to specify the file name right then and there?

Forum|alt.badge.img+7
  • Author
  • January 28, 2008

Hi Tim


Yes I get what you are saying.... you do specify the file there and then, but if you need to work with the filename later in the workflow, you have to decode the attachment either in Infopath (which is how I did it) or inside K2 (at a guess, I havent actually done this).


I've posted the code on my blog:


http://blog.mgallen.com/?p=94


Hope this is useful


Martin