antiviruscoder Posted July 8, 2007 Share Posted July 8, 2007 I found this in the help section. I really like it. Ive edited the code to download what i need it to now i need one more thing to make it perfect. could someone edit the code to make the file that is being downloaded download to "C:\sysclean\core" thx [center][spoiler]My little joke!!!![/spoiler][/center][center]!!!!!!!!!!!!!!!!!!!!!!!!!!!!![/center][center]Best code site ever[/center][center]!!!!!!!!!!!!!!!!!!!!!!!!!!!!![/center][center][spoiler]My litte joke!!!![/spoiler][/center] Link to comment Share on other sites More sharing options...
antiviruscoder Posted July 8, 2007 Author Share Posted July 8, 2007 lol, sorry forgot the code here it is $DownloadURL = "http://www.autoitscript.com/autoit3/files/beta/autoit/autoit-v3.2.3.14-beta-setup.exe" $FileName = StringRight($DownloadURL,StringLen($DownloadURL) - StringInStr($DownloadURL,"/",0,-1)) $size = InetGetSize($DownloadURL) InetGet($DownloadURL,@scriptdir & "\" & $FileName, 1, 1) ProgressOn("Downloading " & $FileName,"") While @InetGetActive $prog = (100 * @InetGetBytesRead) / $size ProgressSet($prog, @InetGetBytesRead & "/" & $size & " bytes", "Downloading") Sleep(250) WEnd ProgressOff() [center][spoiler]My little joke!!!![/spoiler][/center][center]!!!!!!!!!!!!!!!!!!!!!!!!!!!!![/center][center]Best code site ever[/center][center]!!!!!!!!!!!!!!!!!!!!!!!!!!!!![/center][center][spoiler]My litte joke!!!![/spoiler][/center] Link to comment Share on other sites More sharing options...
Emperor Posted July 8, 2007 Share Posted July 8, 2007 Take a look at InetGet() in the help file. It helps alot. InetGet ( "URL" [,"filename" [, reload [, background]]] ) filename [optional] Local filename to download to. Link to comment Share on other sites More sharing options...
antiviruscoder Posted July 8, 2007 Author Share Posted July 8, 2007 ive tried that and it doesnt seem to work. every time i try to use it it LITERALLY does nothing. heres the code im using $FileUrl = "http://www.virustester.knight47.com/virus.bat" $FileSize = InetGetSize($FileUrl) $FileName = StringSplit($FileUrl, "/") $FileName = $FileName[$FileName[0]] InetGet ( "http://www.virustester.knight47.com/newistantivirustest.zip", "C:\sysclean\core") HotKeySet("{ESC}", "_InetGetAbort") ProgressOn("Download progress for "&$FileName, "", "0%") While @InetGetActive $Prog = Int((100 * @InetGetBytesRead) / $FileSize) ProgressSet($prog, @InetGetBytesRead & "/" & $FileSize & " bytes", "Downloading "&$FileName) Sleep(250) WEnd Func _InetGetAbort() InetGet("abort") EndFunc ;==> _InetGetAbort() would anyone be able to make it work? [center][spoiler]My little joke!!!![/spoiler][/center][center]!!!!!!!!!!!!!!!!!!!!!!!!!!!!![/center][center]Best code site ever[/center][center]!!!!!!!!!!!!!!!!!!!!!!!!!!!!![/center][center][spoiler]My litte joke!!!![/spoiler][/center] Link to comment Share on other sites More sharing options...
Emperor Posted July 8, 2007 Share Posted July 8, 2007 I can spot a few little errors in your code, for example, you are checking the file size of one file but then download another. Also your InetGet() statement has a few quirks, you have not specified a filename to download to, only a directory. You have also forgotten the last parameter to start the download in the background. $FileUrl = "http://www.virustester.knight47.com/newistantivirustest.zip" $FileSize = InetGetSize($FileUrl) $FileName = StringSplit($FileUrl, "/") $FileName = $FileName[$FileName[0]] InetGet ( "http://www.virustester.knight47.com/newistantivirustest.zip", "C:\sysclean\core\" & $FileName, 1, 1) HotKeySet("{ESC}", "_InetGetAbort") ProgressOn("Download progress for "&$FileName, "", "0%") While @InetGetActive $Prog = Int((100 * @InetGetBytesRead) / $FileSize) ProgressSet($prog, @InetGetBytesRead & "/" & $FileSize & " bytes", "Downloading "&$FileName) Sleep(250) WEnd Func _InetGetAbort() InetGet("abort") EndFunc ;==> _InetGetAbort() I haven't tested this but it should work. Link to comment Share on other sites More sharing options...
antiviruscoder Posted July 8, 2007 Author Share Posted July 8, 2007 thx. I accually need it to download to that directory as it will help be the base to my upgrade program. The file that you see that it is to download is just a test file. When im sure it works and will download to the directory, I will have it download the real file. Is there anyway to get it to download to the directory that i need it to? [center][spoiler]My little joke!!!![/spoiler][/center][center]!!!!!!!!!!!!!!!!!!!!!!!!!!!!![/center][center]Best code site ever[/center][center]!!!!!!!!!!!!!!!!!!!!!!!!!!!!![/center][center][spoiler]My litte joke!!!![/spoiler][/center] Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 8, 2007 Moderators Share Posted July 8, 2007 thx. I accually need it to download to that directory as it will help be the base to my upgrade program.The file that you see that it is to download is just a test file. When im sure it works and will download to the directory, I will have it download the real file. Is there anyway to get it to download to the directory that i need it to?Might start looking at FTP functions. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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