S
Stacey Levine
Please tell me if this makes sense.
I have written an ASPX page to handle and process POSTed XML data to it. I
am expected the data to be in the Request.Form object. This works perfectly
fine when data is posted from an HTML page and even from a HTTPWebrequest..
Now.. I was getting strange or no data when receiving posted data from PHP
or from FLASH. If I do something along the lines of the listing below.. it
works and I get that data. So.. This seems like a bandaid to me. Why is the
data not in the Request.From object? What am I missing?
If Request.ContentLength > 0 Then ' not posting from a form, but there's
something in the request object
Try
Dim strmRequest As System.IO.Stream
Dim iStrmLen As Integer
Dim iBytesRead As Integer
Dim i As Integer
Dim strRequest As String
strmRequest = Request.InputStream
iStrmLen = CInt(strmRequest.Length)
Dim arrRequest(iStrmLen) As Byte
iBytesRead = strmRequest.Read(arrRequest, 0, iStrmLen)
For i = 0 To iStrmLen - 1
strRequest = strRequest & Chr(arrRequest(i))
Next i
Dim xDoc As New System.Xml.XmlDocument
Dim xReader As System.IO.TextReader
xDoc.LoadXml(strRequest)
stacey
I have written an ASPX page to handle and process POSTed XML data to it. I
am expected the data to be in the Request.Form object. This works perfectly
fine when data is posted from an HTML page and even from a HTTPWebrequest..
Now.. I was getting strange or no data when receiving posted data from PHP
or from FLASH. If I do something along the lines of the listing below.. it
works and I get that data. So.. This seems like a bandaid to me. Why is the
data not in the Request.From object? What am I missing?
If Request.ContentLength > 0 Then ' not posting from a form, but there's
something in the request object
Try
Dim strmRequest As System.IO.Stream
Dim iStrmLen As Integer
Dim iBytesRead As Integer
Dim i As Integer
Dim strRequest As String
strmRequest = Request.InputStream
iStrmLen = CInt(strmRequest.Length)
Dim arrRequest(iStrmLen) As Byte
iBytesRead = strmRequest.Read(arrRequest, 0, iStrmLen)
For i = 0 To iStrmLen - 1
strRequest = strRequest & Chr(arrRequest(i))
Next i
Dim xDoc As New System.Xml.XmlDocument
Dim xReader As System.IO.TextReader
xDoc.LoadXml(strRequest)
stacey