Sign in to follow this  
Followers 0
francesco9696

Big file file download in Autoit with referer. InetGet/WinHttp

2 posts in this topic

#1 ·  Posted

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.

Share this post


Link to post
Share on other sites



#2 ·  Posted

Use "HEAD" method instead of default ("GET") with request.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0