Reading the xml file in server without saving it

Posted by Sathish on Stack Overflow See other posts from Stack Overflow or by Sathish
Published on 2010-04-21T02:42:07Z Indexed on 2010/04/21 2:43 UTC
Read the original article Hit count: 305

Filed under:

I am uploading an xml file in asp.net. what i want to do is to read the file and convert it to xmldoc and send it to one webservice without saving the xml file in the server. Is it possible? If yes can anyone help me with the code. The code i wrote so far is as below

HttpPostedFile myFile = filMyFile.PostedFile;
int nFileLen = myFile.ContentLength;
if (nFileLen > 0)
{
byte[] myData = new byte[nFileLen];
myFile.InputStream.Read(myData, 0, nFileLen);
}

© Stack Overflow or respective owner

Related posts about c#