Skip to content

deusprogrammer/Simple-FTP-Client-Library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

//TODO
//   Replace simSock with new universal version
//   to allow Linux to use this library too.

//USAGE

#include <stdio.h>
#include "simFtp.h"

int main()
{
	Directory* dir;
	FTP_Connection* ftp;

	//Load Winsock2 Library
	InitializeWS();

	//Create FTP connection object
	ftp = new FTP_Connection(hostname, username, password);

	//Connect to FTP server
	ftp->connect();

	//Get directory listing
	dir = ftp->ls();

	//Examine each directory entry and download file
	for(int i=0; i<dir->numEntries(); i++)
	{
		dir_e = dir->GetEntry(i);
		
		//Do whatever you want with directory entry information

		//Download file to root of the C drive
		printf("Downloading %s\n", dir_e->getFileName());
		ftp->get(dir_e->getFileName(), "C:\\");
	}

	//Disconnect from FTP server
	ftp->disconnect();	

	//Unload Winsock2 Library
	CleanupWS();

	return 0;
}

About

Add FTP functionality to your program

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages