Programmatic File Creation / Attachment - InfoPath Dev
in

InfoPath Dev

Programmatic File Creation / Attachment

Last post 05-07-2010 12:57 PM by sjb_dev. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 05-07-2010 12:28 PM

    Programmatic File Creation / Attachment

    I'm creating a xlsx file utilizing the ExcelPackage object, and would like to set this byte[] as an attachment within my 2007 IP Browser Enabled form. I'm creating the excel file and converting it to base64 before attachmentNode.setvalue(), but I keep getting the following error: Schema validation found non-data type errors. Any ideas? ... byte[] filedata = xlsxPkg.GetAsByteArray(); ... attachmentNode.SetValue(Convert.ToBase64String(filedata));
  • 05-07-2010 12:47 PM In reply to

    Re: Programmatic File Creation / Attachment

    after a few more tests, my code works if i add an attachment manually to the file attachment field first, and then run my code against it. the manually uploaded attachment is overwritten with my programmatically created xlsx file. do i need to clear some value out of an empty file attachment control before programmatically setting the value?
  • 05-07-2010 12:57 PM In reply to

    Re: Programmatic File Creation / Attachment

    this line did it: if (attachmentNode.MoveToAttribute("nil", http://www.w3.org/2001/XMLSchema-instance")) { attachmentNode.DeleteSelf(); }
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.