Advertisement
Guest User

Untitled

a guest
May 27th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Set xmlHTTP = CreateObject("Msxml2.XMLHTTP")
  2.  
  3. xmlHTTP.Open "POST", strFileURL, False
  4.  
  5. xmlHTTP.send
  6.  
  7.    If xmlHTTP.Status = 200 Then
  8.  
  9.       Set objADOStream = CreateObject("ADODB.Stream")
  10.       objADOStream.Open
  11.       objADOStream.Type = 1 'adTypeBinary
  12.  
  13.       objADOStream.Write xmlHTTP.ResponseBody
  14.       objADOStream.Position = 0 'Set the stream position to the start
  15.  
  16.       Set objFSO = Createobject("Scripting.FileSystemObject")
  17.         If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
  18.       Set objFSO = Nothing
  19.  
  20.       objADOStream.SaveToFile strHDLocation
  21.       objADOStream.Close
  22.  
  23.       Set objADOStream = Nothing
  24.  
  25.    End if
  26.  
  27. Set xmlHTTP = Nothing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement