2

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
ChriSxStyles
  • 383
  • 1
  • 3
  • 11

1 Answers1

2

"Error: Not enough storage is available to complete this operation."

Have you checked to ensure that you actually have enough disk space for the download file?

user48838
  • 7,431
  • 2
  • 18
  • 14
  • Yes, the problem is not the disk space. Disk is 80% free. That error message has to be pertaining to something else rather than the disk space. – ChriSxStyles Jun 19 '11 at 01:57
  • 1
    Then you might look through the possible VB Script settings for any possible limits which might need to be raised. Also check the possible "temp" settings/definitions to ensure it is not parked somewhere which may be attributing to the situation. – user48838 Jun 19 '11 at 03:06