请问:为什么ftp的APPE命令没有增加文件的内容呢
smae 2004-02-14 04:09:07 服务器是是增加了一个test.txt,但长度是0
我在命令窗口里打appe g:\test.txt test.txt则没有问题,服务器上的文件长度增加了,请指教,谢谢
CHAR szTemp[256];
wsprintf (szTemp, "APPE %s", "test.txt");
BOOL bRet = FtpCommand(hConnection,
TRUE,
FTP_TRANSFER_TYPE_ASCII,
szTemp,
0,
&hResponse);// The handle to read the response
if (!bRet) {
cout << "FtpCommand failed, error: " << GetLastError() << endl;
return;
}
wsprintf (szTemp, "This data will be appended to the file");
DWORD dwSize;
if (!InternetWriteFile (hResponse, (LPVOID)szTemp, lstrlen(szTemp)+1, &dwSize)) {
cout << "InternetWriteFile failed, error: " << GetLastError() << endl;
return;
}