Problem with decoding InfoPath attachments(MS Word documents). - InfoPath Dev
in

InfoPath Dev

Problem with decoding InfoPath attachments(MS Word documents).

Last post 10-21-2009 02:54 PM by Greg Collins. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 10-20-2009 05:49 PM

    Problem with decoding InfoPath attachments(MS Word documents).

     Hi all,

                I have a problem here while working on decoding an InfoPath attachment in the VSTA code using this link.  http://support.microsoft.com/kb/892730. This code is working fine for converting Base64binary into a byte array. But the problem here is, we can't assign a byte array to a field in infopath form. For this, I need to convert this byte[ ] into a string to assign to a particula field in InfoPath. When ever i try to assign a string value, which is decoded from an "MS word" document attached to the infopath attachment control, it's throwing an error "An invalid character was found in text content ". 

                             But the same concept is working fine for "notepad" files. If it is a word document or PDF, then it's showing the string value in a different language like  "content = "PK \0 \0\b\0\0\0!\0???7f \0\0 \0\0 \0\b [Content_Types].xml ? (?\0 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\...".     

                         I have searched a lot on Web for the solution, unfortunately i didn't get any. Eagerly waiting for a solution.

     

    Thanks,

    Kalyan.

    Filed under: ,
  • 10-21-2009 02:54 PM In reply to

    Re: Problem with decoding InfoPath attachments(MS Word documents).

    Why are you trying to assign a byte array as a field value? InfoPath uses Base64Binary for files and images. I don't follow why you are converting from base64 to begin with? If you are trying to dig into the innards of the file itself, then why bother assigning it to a field value instead of just working within the code?

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.