После прочтения файла вы можете писать с использованием объекта Stream.
Это эффективный способ потоковой передачи больших файлов.
Кстати, не забывайте обрабатывать все возможные ошибки.
Request.asp
Dim pXML
pXML = "<XmlRequest><FileNo>123</FileNo></XmlRequest>"
Dim http, http_response
Set http = CreateObject("MSXML2.ServerXMLHTTP")
http.Open "GET", "http://test.com/response.asp?xml_request=" & pXML, False
http.Send
http_response = http.responseText
If http.Status = 200 Then 'OK
Response.Write http_response 'ready with xml string
Else
Response.Write "An error ocured : <hr />"& http_response
Response.End
End If
Set http = Nothing
Response.asp
Dim xml_request
xml_request = Request.QueryString("xml_request")
Dim xd
Set xd= Server.CreateObject("Msxml2.DOMDocument")
xd.async = False
xd.loadXML(Xml_Request)
If xd.parseError.errorCode <> 0 Then Err.Raise 8, "", _
"Request does not contain a valid xml string : '" & xml_request &"'"
Dim FileNo
Set FileNo = xd.documentElement.selectSingleNode("FileNo")
If FileNo Is Nothing Then
Err.Raise 8, "", "Node does not exists : FileNo"
Else
FileNo = FileNo.Text
End If
Dim FilePath
FilePath = Server.Mappath(FileNo & ".xml")
Dim fso
Set fso = Server.CreateObject("Scripting.FileSystemObject")
If Not fso.FileExists(FilePath) Then Err.Raise 8, "", "File Not Found : " & FilePath
Const adTypeBinary = 1
Dim str
Set str = Server.CreateObject("Adodb.Stream")
str.Type = adTypeBinary
str.open
str.LoadFromFile FilePath
While Not str.EOS
If Not Response.IsClientConnected Then Response.End
Response.BinaryWrite str.Read(8192)
Wend