Jump to content
Sign in to follow this  

testing download integrity

Recommended Posts

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
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")

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...