none
Extract attachment from HTTP POST (Stream) RRS feed

  • Question

  • Hi there,

    Web service needs to extract attachment (can be any type) from Stream.

    Stream comes from a Frevvo form. Frevvo form posts posts the data(xml and attachment) to the WCF RESTFul web service method. Stream also consists of an xml document, which is simply extracted as shown below. Now it is required to extract the attachment from the Stream.

    //Read or extract XML doc from the Stream
    
                StreamReader sreader = new StreamReader(inStream);
                string xml = sreader.ReadToEnd();
                sreader.Close();
                int startPos = xml.IndexOf("<ns:form");
                int endPos = xml.IndexOf("</ns:form>");
    
                string data = xml.Substring(startPos, (endPos + 10) - (startPos));
    
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(data);
    Help is finding starting and end index positions of the attachment is greatly appreciated.


    Apriori algorithm [association rule]



    • Edited by Raju Golla Friday, January 11, 2013 4:56 AM
    Friday, January 11, 2013 12:14 AM

All replies

  • Hi,

    Thanks for your post.

    I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, January 14, 2013 1:54 AM
    Moderator
  • Thanks Haixia.

    I look forward to receive best help.


    Apriori algorithm [association rule]

    Monday, January 14, 2013 10:22 AM
  • Hello,

    Unfortunately, the nature of this question will require a high level of depth skill set from MSFT support staff to troubleshoot and resolve.  I would suggest opening a support case for further investigation of this issue.

    Please visit Microsoft Support at : http://support.microsoft.com

    Thank you,

    Madiha

    Wednesday, June 5, 2013 8:43 PM
    Moderator