Jump to content

TFTP Client & Server

Recommended Posts

Hello all :),

This Topic is to continue the topic from "General Help and Support" > '?do=embed' frameborder='0' data-embedContent>> , LarryDalooza was right, this might fit better this forum...

So for those who don't wish to read the previous posts from genral help and support:

I'm trying to make a TFTP client and server implementation, just for my own amusement (and offcurse to improve my skills with AutoIT and RFC based protocol implementation).

Unfortunatly I don't have much time to work in this durring the week, I only have time for this kind of "hobby" projects in the weekends. For those who are intersted in this example of protocol implementation I will post here the current state of the project as well as source files for it.

- I try to implement to whole thing (both client and server) in a single UDF.

- Test requirements: you will need to install a working copy of tftpd32: http://tftpd32.jounin.net/tftpd32_download.html

here is what I got so far:

_TFTP.au3 <- the TFP UDF, I know it still has bugs, this is the current working version, currently it only handels file downloads (RRQ's) also for "safety" reasons it adds the "DLD_" filename prefix to downloaded file names, so it can be runned from the tftp32 directory without over writing files, still I would sugest to put the au3 files in a different directory than the tftp32

2.au3 <- a small example on how to use this UDF

!! keep in mind: the UDF is still a work in progress in which currently only the RRQ feature works and still dosen't handels all the TFTP parameters/responses correctly, so far it only works with tftp32 correctly!

Hope you enjoy this, I will try to post an update (and improved code) in every weekend till I finally finish this UDF :)



Link to post
Share on other sites
  • 4 years later...

I found issues using this UDF when the remote file was in a subfolder.

It was not in the request but in the writing out the response.  I changed a line in _TFTP_DATA:

$WriteOutTo = FileOpen($FileLocalPath & "\" & $TFTPGetFilename, 2)


$WriteOutTo = FileOpen($FileLocalPath & "\" & StringMid( $TFTPGetFilename, StringInStr( $TFTPGetFilename, "\", 0, -1 ) + 1 ), 2)

So downloading the remote file:  subfolder\filetoget.txt will download in your local target path as filetoget.txt.

Otherwise, you would have had to pre-created the subfolder in your local target path to make it work.

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...