This recipe will show you how to download a file using the XMLHttp
object, which we have seen in action in the Checking whether page links are broken recipe. Here we will expand on a theme and see how to synchronize our script using the onreadystatechange
event handler to report on the progress of our download. The code includes the required modifications, and is the same as the one I used in a project a few years ago.
From the File menu, navigate to New | Function Library or use the Alt + Shift + N shortcut. Name the new function library as Web_Download.vbs
. To use the AutoItX
COM object, go to https://www.autoitscript.com/site/autoit/downloads/ to download and install AutoIt. This is absolutely necessary in order to ensure that the code given here will work properly with regard to the notifications display.