marabunta Posted March 18, 2016 Share Posted March 18, 2016 (edited) Hi, EDIT: done $FileURL = "http://site.de/file.txt" $FileName = @TempDir & "\file.txt" $Downloadtimeout = 60000 $INET_DOWNLOADBACKGROUND = 1 $INET_DOWNLOADCOMPLETE = 2 Func Download($FileURL, $FileName, $Downloadtimeout) Local $hDownload = InetGet($FileURL, $FileName, 19, $INET_DOWNLOADBACKGROUND) $begin = TimerInit() Do Sleep(250) $fDiff = TimerDiff($begin) If ($fDiff > $Downloadtimeout) Then InetClose($hDownload) ExitLoop EndIf Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE) ; Retrieve details about the download file. Local $aData = InetGetInfo($hDownload) If @error Then FileDelete($FileName) Return False ; If an error occurred then return from the function and delete the file. EndIf InetClose($hDownload) EndFunc ;==>Download Download($FileURL, $FileName, $Downloadtimeout) Edited March 18, 2016 by marabunta Link to comment Share on other sites More sharing options...
Gianni Posted March 18, 2016 Share Posted March 18, 2016 $INET_DOWNLOADBACKGROUND = 1 Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now