How to receive the xml file from client-side(javascript,i usejQuery)?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JUN

    How to receive the xml file from client-side(javascript,i usejQuery)?

    Sends an xml document as data to the server. By setting the
    processData option to false, the automatic conversion of data to
    strings is prevented.

    code from jQuery documentation

    var xmlDocument = [create xml document];
    $.ajax({
    url: "save.aspx" ,
    processData: false,
    data: xmlDocument,
    success: handleResponse
    });

    Now,in server script, how do i read the xmlDocument and save a file.my
    code like this,but it can't work.

    private void Page_Load(objec t sender, System.EventArg s e){
    Stream stream = Request.InputSt ream;
    XmlDocument doc = new XmlDocument();
    try
    {
    doc.Load(stream ); // it will goto catch
    doc.Save(Server .MapPath("bbbbb bbbbbbbbbbbbbbb b.xml"));
    }
    catch
    {
    }

    }

    Thanks a lot. it's very urgent.
Working...