J
jdhancock
Can someone give me an example of how I can execute a program on a
corporate server and then download the response to the user? I'm not
sure if I'm asking this right.
Here is the asp code used today. I am attempting to recreate in
ASP.NET.
Thanks in advance,
Clem
--------------------------------------------------------------------------------------------------------------------------------------
Set HttpObj = Server.CreateObject("WinHTTP.WinHTTPRequest.5.1")
HttpObj.setTimeouts 5000, 5000, 15000, 15000
HttpObj.open "GET", "http://" & serverpath & "/doc_qanda.exe?" &
Escape(doc_num) & ",1", False
HttpObj.send
html = HttpObj.responseText
pos = Instr(html, "window.location=""") + 17
If Not Response.IsClientConnected Then
Set HttpObj = Nothing
Response.End
End If
If pos > 17 Then
HttpObj.setTimeouts 5000, 5000, 15000, 15000
HttpObj.open "GET", Mid(html, pos, Instr(pos, html, """") - pos),
False
HttpObj.send
End If
BinaryData = HttpObj.responseBody
ContentType = HttpObj.getResponseHeader("Content-Type")
Set HttpObj = Nothing
If Not Response.IsClientConnected Then
Response.End
End If
Response.AddHeader "Content-Type", ContentType
Response.AddHeader "Content-Length", LenB(BinaryData)
Response.AddHeader "Content-Disposition", "attachment; filename=" &
Escape(handle)
Response.BinaryWrite BinaryData
Response.Flush
%>
--------------------------------------------------------------------------------------------------------------------------------------
corporate server and then download the response to the user? I'm not
sure if I'm asking this right.
Here is the asp code used today. I am attempting to recreate in
ASP.NET.
Thanks in advance,
Clem
--------------------------------------------------------------------------------------------------------------------------------------
Set HttpObj = Server.CreateObject("WinHTTP.WinHTTPRequest.5.1")
HttpObj.setTimeouts 5000, 5000, 15000, 15000
HttpObj.open "GET", "http://" & serverpath & "/doc_qanda.exe?" &
Escape(doc_num) & ",1", False
HttpObj.send
html = HttpObj.responseText
pos = Instr(html, "window.location=""") + 17
If Not Response.IsClientConnected Then
Set HttpObj = Nothing
Response.End
End If
If pos > 17 Then
HttpObj.setTimeouts 5000, 5000, 15000, 15000
HttpObj.open "GET", Mid(html, pos, Instr(pos, html, """") - pos),
False
HttpObj.send
End If
BinaryData = HttpObj.responseBody
ContentType = HttpObj.getResponseHeader("Content-Type")
Set HttpObj = Nothing
If Not Response.IsClientConnected Then
Response.End
End If
Response.AddHeader "Content-Type", ContentType
Response.AddHeader "Content-Length", LenB(BinaryData)
Response.AddHeader "Content-Disposition", "attachment; filename=" &
Escape(handle)
Response.BinaryWrite BinaryData
Response.Flush
%>
--------------------------------------------------------------------------------------------------------------------------------------