The above method would probably be the best, you may want to check if you are on a Win32 or Unix platform, and call the appropriate ftp programs. If you would like to actually write your own ftp client, I don't recomend it (although it can be a good learning experiance), you should read some of the
RFCs. Here is some
c source code that may also help you.