submit attachment in infopath to sharepoint list - InfoPath Dev
in

InfoPath Dev

submit attachment in infopath to sharepoint list

Last post 04-11-2013 11:48 AM by Hilary Stoupa. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 04-05-2013 11:04 PM

    • stara
    • Top 200 Contributor
    • Joined on 10-20-2010
    • Posts 54

    submit attachment in infopath to sharepoint list

    Is it possible to submit attachment in infopath form to sharepoint list using CAML? Can you please share the code? Thanks Stara
  • 04-06-2013 09:37 AM In reply to

    Re: submit attachment in infopath to sharepoint list

     Not using CAML, I'm afraid - you can use CAML to create the list item and then code + AddAttachment web method to add the attachment (our product qRules also does this, if third party add ons are an option for you).

    Hilary Stoupa

  • 04-09-2013 12:09 PM In reply to

    • stara
    • Top 200 Contributor
    • Joined on 10-20-2010
    • Posts 54

    Re: submit attachment in infopath to sharepoint list

    Is it possible to write code without using CAML?

     

    Is it possible to use this code using VSTA? If so, what references do I use?

     

    Thanks

    // Retrieve the base64 encoded string of the attached file
    string attachedFile =
      MainDataSource.CreateNavigator().SelectSingleNode(
      "//my:document", NamespaceManager).Value;


    // Convert the base64 encoded string into a byte array
    InfoPathAttachmentDecoder decoder =
      new InfoPathAttachmentDecoder(attachedFile);
    byte[] attachment = decoder.DecodedAttachment;
    string fileName = decoder.Filename;


    // Add the file as an attachment to the SharePoint list item
    item.Attachments.Add(fileName, attachment);

  • 04-10-2013 04:44 PM In reply to

    Re: submit attachment in infopath to sharepoint list

     I'm sorry, I'm confused by your question. If you are going to use the UpdateListItems method of the Lists web service - you have to submit CAML. You can create the CAML in code. If this is a browser form, you could use the SharePoint object model.

    Hilary Stoupa

  • 04-11-2013 08:47 AM In reply to

    • stara
    • Top 200 Contributor
    • Joined on 10-20-2010
    • Posts 54

    Re: submit attachment in infopath to sharepoint list

    Sorry for not being clear. Yes it's a browser form. But how would I write code using Sharepoint object model? I would like the code to submit data and infopath attachment to sharepoint list.

     Please advice.

     

    Thanks

     

     

     

  • 04-11-2013 11:48 AM In reply to

    Re: submit attachment in infopath to sharepoint list

    You can find code samples on MSDN - try this link.

    Hilary Stoupa

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