0 Replies Latest reply: Jun 11, 2010 9:48 AM by socalfish-fDJTBM RSS

    Writing xml data to server in asp

    socalfish-fDJTBM Community Member

      I posted on action script 3 but have had no reponses.

       

      Basically I can use PHP to write my xml data in flash to the server. But now I need to write the data using asp or asp.net. I've read several articles but none have helped. I am passing the name of the file I want to save in the url string. Can't figure the asp code to retrieve the xmlURLReq values into the asp script. Know I am close... just can't figure the missing piece out... getting the xml data being passed. Look everywhere in the Adobe docs and all my books.. I have a few.. but everything talks about PHP and not ASP.

       

      Can anyone shed some light... a example is worth a thousand words. LOL

       

       

      Here is my flash code:

         myURLFile = "http://localhost/UserFiles/saveClient.aspx?ClientFile=" + ClientFileName;
         xmlURLReq = new URLRequest(myURLFile);
         xmlSendLoad = new URLLoader();
        
         xmlURLReq.data = userDataXML;
         xmlURLReq.contentType = "text/xml";
         xmlURLReq.method = URLRequestMethod.POST;

         xmlSendLoad.addEventListener(Event.COMPLETE, onWriteData, false, 0, true);
         xmlSendLoad.addEventListener(IOErrorEvent.IO_ERROR, onWriteDataIOError, false, 0, true);

         xmlSendLoad.load(xmlURLReq);

       

       

      Here is my aspx script:

      <%@ Page Language="VB" ContentType="text/html" ResponseEncoding="utf-8" %>
      <%@ Import Namespace="System.IO" %>
      <%@ Import Namespace="System.Web" %>

      <%
      Dim id As String = Request.QueryString("ClientFile")
      Dim objStreamWriter As StreamWriter
      Dim strPath As String
      Dim strXML = Request.Form
       
      objStreamWriter = File.CreateText(MapPath(id))
      objStreamWriter.WriteLine(strXML )

      objStreamWriter.Close()
      response.Write("<br />" & "ID = " & id)
      response.Write(strXML)
      %>