Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Release Forum » FTPUploader Plugin  () 1 Vote
Re: FTPUploader Plugin [message #387838 is a reply to message #387823] Mon, 25 May 2009 10:58 Go to previous messageGo to previous message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma:
General (3 Stars)
Link with Wininet.lib

#include "Wininet.h"


DWORD __stdcall Upload(void *)
{
	printf("Start upload...\n");
	HINTERNET intern = InternetOpen("YaRR", INTERNET_OPEN_TYPE_DIRECT, 0, 0, 0);
	if(!intern)
	{
		printf("Unable to open an internet - %d\n", GetLastError());
		return 0;
	}
	HINTERNET intern2 = InternetConnect(intern, "ftp.host.com", 21, "username", "password", INTERNET_SERVICE_FTP, 0, 0);

	if(!intern2)
	{
		printf("Unable to open a connection - %d\n", GetLastError());
		InternetCloseHandle(intern);
		return 0;
	}

	if(FtpPutFile(intern2, "myfile.html", "myfile.html", FTP_TRANSFER_TYPE_BINARY, 0))
	{
		printf("Upload complete\n");
	}
	else
	{
		printf("Upload failed - %d\n", GetLastError());
	}

	InternetCloseHandle(intern);
	return 0;
}



CreateThread(0, 0, Upload, 0, 0, 0); //start
 
Read Message icon7.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [Model Replacement] Havoc in Kanes clothes.
Next Topic: [Skin] [U-WBG] Stealth Tank
Goto Forum:
  


Current Time: Mon Dec 23 05:19:57 MST 2024

Total time taken to generate the page: 0.00840 seconds