Sign in to follow this  
Followers 0
PartyPooper

INetDownloader UDF

4 posts in this topic

#1 ·  Posted (edited)

A simple UDF that can be used for downloading files via the internet. Includes a progress bar. Useful UDF for scripts that download files rather than having to code it in all the time.

Sample usage:

#include <INetDownloader.au3>
   
Global $s_MyWebSite = "http://members.optusnet.com.au/partypooper"; authors web address
           
OnDownloadFile()
           
Func OnDownloadFile()
  _INetDownloader($s_MyWebSite, "Program.exe", -1, @DesktopDir)
EndFunc;==>OnDownloadFile

Format for the UDF is as follows:

#include <INetDownloader.au3>
   
Func _INetDownloader( Web Site, Remote Filename [, Local Filename [, Download Directory [, AutoOverwrite]]] )

Parameters

Web Site - website containing the file

Remote Filename - filename to be downloaded.

Local Filename - filename to be saved. Default (-1) = same as Remote Filename

Download Directory - directory where file will be saved. Default (-1) = @TempDir

AutoOverwrite - specifies whether or not to overwrite local file if found. Default (-1) = Yes

Return Value

On Success: Downloads and auto installs (if chosen), the update.

On Failure:

- sets @ERROR = 1 for function parameter errors

- sets @ERROR = 2 if internet problems or file not found

- sets @ERROR = 3 if file exists and is not overwritten

Remarks

Nil.

Edit1: Updated UDF source - several bugfixes (24 downloads)

NO LONGER BEING MAINTAINED - superseded by @InetFileUpdate

Edited by PartyPooper

Share this post


Link to post
Share on other sites



Nice little downloader... The progress bar is a bit jittery, but I like it. Thank you for sharing...

Share this post


Link to post
Share on other sites

Thanks. It's the standard AutoIt progress bar so I'm not sure what you mean by "jittery"?

Oh, I updated the first post - forgot to add the download directory in the example above.

Share this post


Link to post
Share on other sites

Updated script and squashed several bugs - see first post.

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