Embed file into form - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Embed file into form

Last post 08-06-2008 05:31 PM by Hilary Stoupa. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 06-25-2008 03:30 AM

    Embed file into form

    Hi All,

    can anybody tell me how to embed a file, which is in my local drive, into infopath form programmatically?

     

    Thanks,

    Jaimin 

    Filed under:
  • 06-25-2008 08:31 AM In reply to

    Hello:

     Here are two different links that can get you started: http://www.classdotnet.com/CsReadToByteArray.html has a code sample that reads a file (like the one on your local drive) into a byte array. This post: http://blogs.msdn.com/jannemattila/archive/2007/02/08/transferring-attachment-file-from-web-service-to-infopath.aspx has a code sample for turning a byte array into a base 64 string. All you'll need to do is get the node that is bound to your file attachment and set its value to the base 64 string that is returned from the method in the second post. If you need more help, please let me know.

    Hilary Stoupa

    Filed under:
  • 06-25-2008 09:57 PM In reply to

    Thanks for your response Hilary. In the second link, DocumentContainer is used. Check this line:

    DocumentContainer myDocument;

    How can I get this?? Do I have to include any namespace or reference or something else??

     

    I need to know what can be done for the following scenario:

    I have a infopath form along with file attachment control and a button. My requirement is using file attachment I have to upload a file from my local drive and on button click I have to zip it and attach it again to the same form, so that when some other user opens that form he should be able to see only an attached zip file. 

    I hope I am clear with my scenario.

     

    Thanks in advance

    Jaimin 

  • 08-06-2008 05:31 PM In reply to

    Oh -- I feel bad! I just saw that you had additional questions -- I'm sorry I didn't see this earlier. Were you able to solve your issue?

    Hilary Stoupa

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