MarshallSoft

C/C++ FTP Example


// C/C++ FTP Example

#include <windows.h>
#include <stdio.h>
#include "fce.h"

// download file from FTP server

int Download(char *Host, char *User, char *Pass, char *Folder, char *FileName)
{int Code;
 // connect to server (Host)
 Code = fceConnect(0, Host, User, Pass);
 // error ? (negative return codes are errors)
 if(Code<0) return Code;
 // change to proper directory
 Code = fceSetServerDir(0, Folder);
 if(Code<0) return Code;
 // set binary xfer mode  fceSetMode(0,'B');
 // download the file
 Code = fceGetFile(0, FileName);
 return Code;
}

MSC Logo

HOME PAGE
MARSHALLSOFT is a trademark of MarshallSoft Computing, Inc.