Jump to content

Recommended Posts

Posted

here's a way to test whether or not a file was downloaded properly. @InetGetBytesRead equals FileGetSize(file after downloading) equals InetGetSize(file on remote server). They will all have the exact same byte count (which we would only expect in utopia, but hey it works!) just an example so you can see. hope someone finds it useful :

InetGet("http://www.autoitscript.com/cgi-bin/getfile.pl?autoit3/autoit-v3-setup.exe", @TempDir & "\autoit-v3-setup.exe", 0, 1)
While @InetGetActive
    Sleep(250)
WEnd
MsgBox(1, "", "Remote Size: " & InetGetSize("http://www.autoitscript.com/cgi-bin/getfile.pl?autoit3/autoit-v3-setup.exe") & @CRLF & "Local Size: " & FileGetSize(@TempDir & "\autoit-v3-setup.exe") & @CRLF & "Bytes downloaded: " & @InetGetBytesRead)
FileDelete(@TempDir & "\autoit-v3-setup.exe")

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
×
×
  • Create New...