Has anyone been successful with downloading large files via VBScript? My script is below and it is erroring out downloading a file over a 1GB. Small files it works with no problem. Do I need to try a different method? The error message it gives me is below. Thanks in advance for any suggestions!
strFileURL = "http://10.0.0.0/File.zip"
strHDLocation = "C:\File.zip"
Set objXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP")
objXMLHTTP.open "GET", strFileURL, false
objXMLHTTP.setTimeouts 1000 * 60 * 60, 1000 * 60 * 60, 1000 * 60 * 60, 1000 * 60 * 60
objXMLHTTP.send()
If objXMLHTTP.Status = 200 Then
Set objADOStream = CreateObject("ADODB.Stream")
objADOStream.Open
objADOStream.Type = 1 'adTypeBinary
objADOStream.Write objXMLHTTP.ResponseBody
objADOStream.Position = 0 'Set the stream position to the start
Set objFSO = Createobject("Scripting.FileSystemObject")
If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
objADOStream.SaveToFile strHDLocation
objADOStream.Close
Set objADOStream = Nothing
End if
Set objXMLHTTP = Nothing
Set objFSO = Nothing
The error message I receive is:
Error: Not enough storage is available to complete this operation.
Code: 8007000E
Source: msxml3.dll