You are here:

ActiveXperts.com > ActiveSocket > Objects > Tftp

ActiveSocket Toolkit Add network capabilities to any Windows or .NET application

Quicklinks


ActiveSocket - Tftp Object

Today, there are many TFTP client tools available. However, most of these software tools are stand-alone packages, without scripting options. ActiveSocket is very well suited for scripting and embedding in applications.

Use the ActiveSocket Tftp object to script the following:

  • Connect to a remote FTP server;
  • Download files (ftp 'get'), ASCII or binary;
  • Upload files (ftp 'put'), ASCII or binary;

The Tftp object is part of the ActiveSocket component. Overview of all ActiveSocket objects:

Tftp Sample code

VBScript sample: Tftp get sample

   Set objTftpServer = CreateObject ( "ActiveXperts.TftpServer" ) 
 
   objTftp.Get "10.1.1.10", "/folder1/file.txt", "c:\\file.txt"    ' Download file, save it locally 
   Wscript.Echo "Get, result: " & objTftp.LastError 
   If( objTftp.LastError <> 0 ) Then                               ' If download failed then quit
      WScript.Quit
   End If

   WScript.Echo "Packets received: " & objTftp.PacketsReceived     ' Print download statistics
   WScript.Echo "Bytes received: " & objTftp.BytesReceived         ' Print download statistics

On ftp.activexperts-labs.com, you can find a lot of ActiveSocket samples. These samples are also part of the ActiveSocket installation.

Visit ftp.activexperts-labs.com