Need help with Wininet - Overwrites my file [FTP]

Hi. I'm using the wininet api.

Im trying to write stuff to a file wich is located on my server via FTP.

Everything works just fine.

BUT!

When i want to write something new to that file, it owerwrites the last value.

I don't want it to overwrite it. I just want to add new data to it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
string user = "apaaaasdasdasdsdsa";

	HINTERNET hInternet;
	HINTERNET hFtpSession;
	hInternet = InternetOpen(NULL, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
	hFtpSession = InternetConnect(hInternet, "ftp.blabla", port, "blablabla", "password", INTERNET_SERVICE_FTP, 0, 0);

	// Testing
	HINTERNET hFile = FtpOpenFile(hFtpSession, "test.html", GENERIC_WRITE , FTP_TRANSFER_TYPE_ASCII, 0);
	DWORD wb = 0;

	char tab2[1024];
	strcpy_s(tab2, user.c_str());

	InternetWriteFile(hFile, tab2, strlen(tab2), &wb);

	//------------------------------

	InternetCloseHandle(hFtpSession);
	InternetCloseHandle(hInternet);


Anyone has a clue? AS i said. Writing works fine. Tough i don't want it to overwrite.

Have looked all over for flags etc. But cant seem to solve this!

Annoying!

/ Martin

Topic archived. No new replies allowed.