gerwim Posted April 23, 2011 Share Posted April 23, 2011 (edited) Nevermind, I had to change the folder path. (to have the file extension there). ProgressOn("Download", "Downloading...", "0%") $url= "http://fuller.zen.co.uk/test/100MB_nonzero.bin" ;Set URL $folder = @MyDocumentsDir & "\downloads\100mb.bin" ;Set folder $hInet = InetGet($url, $folder, 1, 1) ;Forces a reload from the remote site and return immediately and download in the background $FileSize = InetGetSize($url) ;Get file size While Not InetGetInfo($hInet, 2) ;Loop until download is finished Sleep(500) ;Sleep for half a second to avoid flicker in the progress bar $BytesReceived = InetGetInfo($hInet, 0) ;Get bytes received $Pct = Int($BytesReceived / $FileSize * 100) ;Calculate percentage ProgressSet($Pct, $Pct & "%") ;Set progress bar WEnd ProgressOff() The code does work Edited April 23, 2011 by gerwim Link to comment Share on other sites More sharing options...
Revenger Posted August 7, 2011 Share Posted August 7, 2011 (edited) Nevermind, I had to change the folder path. (to have the file extension there). ProgressOn("Download", "Downloading...", "0%") $url= "http://fuller.zen.co.uk/test/100MB_nonzero.bin" ;Set URL $folder = @MyDocumentsDir & "\downloads\100mb.bin" ;Set folder $hInet = InetGet($url, $folder, 1, 1) ;Forces a reload from the remote site and return immediately and download in the background $FileSize = InetGetSize($url) ;Get file size While Not InetGetInfo($hInet, 2) ;Loop until download is finished Sleep(500) ;Sleep for half a second to avoid flicker in the progress bar $BytesReceived = InetGetInfo($hInet, 0) ;Get bytes received $Pct = Int($BytesReceived / $FileSize * 100) ;Calculate percentage ProgressSet($Pct, $Pct & "%") ;Set progress bar WEnd ProgressOff() The code does work Tested the code works great mind if I use it for my own projects? Is there a way to make the directory automatically as it needs one already setup to work also to make the download window movable when its downloading and have a cancel button? Very new to autoit but very impressed so far with the bits of code around the place. Going to want to flesh this out in a extended bit of code with replacing a file in a directory. Edited August 7, 2011 by Revenger Link to comment Share on other sites More sharing options...
anony10 Posted September 19, 2011 Share Posted September 19, 2011 I wanted to do a downloader, like this (just for fun), but i didnt have idea, how to do.So, thank you man! 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