I'm using CreateObject("MSXML2.ServerXMLHTTP") for long time to automatically download files from my server
recently I can't download getting an error with secured channel
I get the error on .Send
it does not netter if I send the file to get as HTTP or HTTPS
the files are public so no need for UserName or Password
recently I can't download getting an error with secured channel
I get the error on .Send
it does not netter if I send the file to get as HTTP or HTTPS
the files are public so no need for UserName or Password
Code:
Public Function fnDownloadHTTP(strTarget As String, strSaveAs As String, Optional strUserName As String, Optional strPassword As String) As Boolean
' On Error GoTo errHere
Dim xmlHTTP As Object
Dim strRespText As String
fnDownloadHTTP = True
'Set xmlHTTP = CreateObject("Microsoft.XMLHTTP")
Set xmlHTTP = CreateObject("MSXML2.ServerXMLHTTP")
With xmlHTTP
.Open "GET", strTarget, False, strUserName, strPassword
.setRequestHeader "cache-control", "no-cache,must revalidate"
.send
End With
If fnSaveDownloadFile(strSaveAs, xmlHTTP.responseBody) = False Then
fnDownloadHTTP = False
End If
ExitHere:
Set xmlHTTP = Nothing
Exit Function
errHere:
fnDownloadHTTP = False
Resume ExitHere
End Function