Sign in to follow this  
Followers 0
Eambo

What's wrong with this code?

3 posts in this topic

#1 ·  Posted (edited)

I'm sure I'm doing something dumb :-(

Note: DownloadLine is a variable that will attach to the end of the web url. EG: www.website.com/FILE.EXE (FILE.EXE being the DownloadLine)

$DownloadFolder=@ScriptDir & "\" & $DownloadLine

MsgBox(0, "Download Line", $DownloadLine)
MsgBox(0, "Download Folder", $DownloadFolder)


$FileURL = "http://www.website.com/" & $DownloadURL

MsgBox(0, "Download URL", $FileURL)

$FileSize = InetGetSize($FileURL)
 
InetGet($FileURL,$DownloadFolder,0,1) 
 
ProgressOn("","")
While @InetGetActive
    $Percentage = @InetGetBytesRead * 100 / $FileSize
    ProgressSet($Percentage,"Downloaded " & @InetGetBytesRead & " of " & $FileSize & " bytes","Downloading " )
    Sleep(250)
Wend

ProgressOff()
Edited by Eambo

Share this post


Link to post
Share on other sites



Where did you define $DownloadURL?

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Sorry, these were on up the code :-)

$ReplaceErrorText = ''; Replace with nothing
$ReplaceForwardSlash = '/'; Replace with nothing
$DownloadLine = StringReplace ($ErrorLine, '[ERROR]' & @ScriptDir & '\', $ReplaceErrorText); Scans $Errorline for the quoted lines, and replaces with nothing
$DownloadURL = StringReplace ($DownloadLine,'\', $ReplaceForwardSlash);

Above it's essentially making two versions of the same thing. One with a forwardslash for the WebURL, and one with a blackslash for the directory. I'll probably clean this up at a later point, I just wanted to get the concept down and working :-)

Edit: PS, thank you for your help :-)

Edited by Eambo

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