Problem with binary created by a "File Attachment" - InfoPath Dev
in

InfoPath Dev

Problem with binary created by a "File Attachment"

Last post 01-06-2006 12:00 AM by AndersR. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 12-13-2005 05:51 AM

    • nacho
    • Not Ranked
    • Joined on 12-13-2005
    • Posts 4

    Problem with binary created by a "File Attachment"

    I have a "File Attachment" control in the form,and when attaching a video "avi" file, it is converted to binary64 and placed into the XML file, well, when I take this binary64 text in my Web Service and then convert it back into an "avi", but InfoPath had added to the binary64 text some more text and also the name of the original file, something like that:

    ÇIFA   t e s t O n e . a v i

    the result is that I can not open it with any video player because of this anoying line!!

    does anyone knows how to get rid of this line??

    thanks in advance

    nacho
  • 12-14-2005 12:58 AM In reply to

    Re: Problem with binary created by a "File Attachment"

    Hi Nacho and welcome to our forum,
    This has been discussed before. Please search the InfoPath blog that Microsoft does referenced on our resources page. They posted a lengthy articly a while back on how to decode the base64 attachments.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 01-06-2006 12:00 AM In reply to

    Re: Problem with binary created by a "File Attachment"

    Or search this forum :-D

    quote:

    All attachments in InfoPath gets an InfoPath header.

    This header is used to show file data such as size, icon and filename in the form.

    To extract data for your webservice you need to remove this header.

    The data structure of the header is described in the SDK.

    I have done this already for a web service myself, so check out the posting linked below for code.

    Remember when you recieve the infopath attachment filename, that it is has a terminating zero, so you need to remove the last char to make your web service call well-formed.

    http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=1213&SearchTerms=attachment#3532

    hth
    //AndersR



    PS. Patrick you forgot to shameless plug your book, where this is also described ;-)

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