Sorry - I didn't go through your code in detail so I didn't notice the requirement for progress reporting.

You may be able to do a HEAD request on the file to find it's size if the server reports it.
Typically I've used this code for smallish downloads, so can't guarantee how it would work for larger files of around the size
you're dealing with.

Tim



<curt.lindner@gmail.com> wrote in message news:1153279315.153222.134730@i42g2000cwa.googlegroups.com...
> Thanks, I'll give it a shot. Is that just any of the MS XML Libraries?
>
> Most of my code was for the user form and reporting the status. The
> downloads are over a fairly slow VPN connection, and some of the files
> are approaching 100MB, so the status reporting is helpful.
>
> Is there a way to retrieve the file size from HTTP headers using this
> code?
>
>
>
>
> Tim Williams wrote:
>> You could try this instead. A bit less code....
>> Tim
>>
>> ****************************************
>> Sub DownloadFile(sURL As String, sPath As String)
>>
>> Dim oXHTTP As Object
>> Dim oStream As Object
>>
>> Set oXHTTP = CreateObject("MSXML2.XMLHTTP")
>> Set oStream = CreateObject("ADODB.Stream")
>>
>>
>> oXHTTP.Open "GET", sURL, False
>> oXHTTP.send
>>
>> oStream.Type = adTypeBinary
>> oStream.Open
>> oStream.Write oXHTTP.responseBody
>> oStream.SaveToFile sPath, adSaveCreateOverWrite
>> oStream.Close
>>
>> Set oXHTTP = Nothing
>> Set oStream = Nothing
>>
>> End Sub
>> ******************************************
>> --
>> Tim Williams
>> Palo Alto, CA
>>

>