![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: POST XML [Thread Next] Re: POST XMLTo: NULL Date: 4/15/2005 11:41:00 AM <%@ Language=VBScript %>
<%
dim strRequest
dim strResponse
dim lngNumBytes:lngNumBytes = 0
dim BytesArray
dim objRequest
lngNumBytes = Request.TotalBytes
err.Clear()
if (lngNumBytes = 0) then
Response.Write("<H4>Expecting POST of an array of bytes</H4><BR>")
else
BytesArray = Request.BinaryRead(lngNumBytes)
'Transfer the bytes to a string.
if (lngNumBytes <> Request.TotalBytes) then
Response.Write("<H4>Bytes lost in transmission. Please resubmit your
request.</H4></BR>")
else
'Convert data from array of bytes into a string.
strRequest = BinDataToString(BytesArray,lngNumBytes)
if (err.number = 0) then
'Send request string for processing.
'...process, write to DB, etc.
else
Response.Write("<H4>Failed to convert binary data into a string:" & _
"<FONT COLOR=red>" + err.description + "</FONT></H4></BR>")
end if
end if
end if
Function BinDataToString(Binary_Data, Num_Bytes)
Dim Data, Index
Data = CStr(Num_Bytes, vbSpace)
For Index = 0 To Num_Bytes - 1
Mid(Data, Index + 1, 1) = Chr(Binary_Data(Index))
Next 'Index
BinDataToString = Data
End Function
%>
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
