I need to make a file downloader in autoit (with a gui, so also get the downlaod status).
I thought of using the InetGet function, but I cannot set the HTTP_REFERER header, and the site I need to download from is like "http://site.com/last_download.php" and if HTTP_REFERER is set to "http://site.com" it redirects me to the right download link "http://download.server.site.com/random_name.zip", but if there is no header, then it redirects me to home page "http://site.com".
So InteGet is not an option. I then tried WinHttp.au3 UDF and I can make an http call to the page "http://site.com/last_download.php" with the right referer header, but I cannot get the download status, neither set the download location. The file would probably be downloaded in RAM or cache before, then saved to a file via "FileWrite" function. But it's a large file (about 1,7gb).
I could make a winhttp call to get the redirect header from "http://site.com/last_download.php" than using InetGet on the download url retrived by headers, but I don't know if it's possible to get just the headers from a winhttp request. I tried, but I always need to wait for the whole file download before being able to read the returned headers.
How can I do? Thank you and sorry for bad English.