Sign in to follow this  
Followers 0
antiviruscoder

downloader

7 posts in this topic

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]

Share this post


Link to post
Share on other sites



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]

Share this post


Link to post
Share on other sites

Take a look at InetGet() in the help file. It helps alot.

InetGet ( "URL" [,"filename" [, reload [, background]]] )

filename [optional]
Local filename to download to.

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
Share on other sites

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.

[center]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.[/center]

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  
Followers 0