I've found a sample code, which gives me an error when Option Strict is
on
I got this error at: "Response.BinaryWrite(objXml.responseBody)"
responseBody is Object and BinaryWrite method accepts Byte array
code:
'*** Declare the variable
Response.Buffer = True
Dim objXml As New MSXML2.ServerXMLHTTP()
Dim strServer As String
strServer =
"
HTTPS://www.myweb.com/myfolder/mysecurity/mydocuments/mydoc.pdf"
'*** Call the ServerXMLHTTP object
objXml.open("GET", strServer, False, "Bob", "1S34EXW")
'Set the Content type of the request sent
objXml.setRequestHeader("Content-Type", "text/html")
' Send the Request to the server
objXml.send()
'** Trap the Response and display the pdf document in a browser
Response.ContentType = "application/x-msdownload"
Response.AddHeader("Content-Disposition", "filename=download.pdf")
Response.BinaryWrite(objXml.responseBody)
'** Try the Streams to read the response
'** Kill the instance
objXml = Nothing