heelllo i am trying to upload a file to a ftp server,here i smy code:

HINTERNET internet;
	HINTERNET ftp;

	internet = InternetOpen(NULL , INTERNET_OPEN_TYPE_DIRECT , NULL , NULL , 0);
	ftp = InternetConnect(internet , "127.0.0.1" , INTERNET_DEFAULT_FTP_PORT , NULL , NULL , INTERNET_SERVICE_FTP , 0 , 0);
	bool x = FtpPutFile(ftp , "c:\\log.txt" , "logger.txt" , FTP_TRANSFER_TYPE_BINARY , 0);
	if(!x)
	{
		cout << GetLastError() << endl;
	}
	char buff[400];
	DWORD a , size = 256;
	 InternetGetLastResponseInfo(&a , buff , &size);
	 cout << buff << endl;

	InternetCloseHandle(internet);
	InternetCloseHandle(ftp);

my FptPutFile returns this:

12003
200 Type set to I.

200 PORT Command successful.

550 Operation not complete

as a ftp server i am using Golden Ftp server....

Recommended Answers

All 2 Replies

> ftp = InternetConnect(internet , "127.0.0.1"
Why are you trying to upload it to yourself?

to test that it works....it works now,ive installed another ftp server

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.