Jump to content
Sign in to follow this  

InetGet & FileSaveDialog .. not working

Recommended Posts


I'm trying to achieve something fairly straightforward, get a file remotely, then prompt for the download location, but the FileSaveDialog isn't working. 

$FileDownload = FileSaveDialog("Save File To...","","*.msi",$FD_PROMPTOVERWRITE,"Chrome")
$hInet = INetGet($Download, $FileDownload,1,1)
ProgressOn("Downloading", "Google Chrome Version " & $RemoteFile, "0%")
$FileSize = InetGetSize($Download) ;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

$Download is defined earlier on in the code, but why isn't this working?  It goes on to actually download something - to what location I have no idea as it has no file save location!

Share this post

Link to post
Share on other sites

Wow, something as simple as two brackets!  Thanks, quite a simple fix :)

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.