Jump to content

What's wrong with this code?


Eambo
 Share

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...