It seems I'm running into an issue when trying to upload to an FTP server. Whenever I finish recording a demo, I want my plugin to upload it to a given server, but for some reason, it keeps stalling when the current uploaded bytes reach 131072. My code here is as shown, am I doing everything right?
...
LogDebug("Sent our request!");
System2FTPRequest ftpRequest = new System2FTPRequest(FtpResponseCallback, remoteDemoPath);
ftpRequest.AppendToFile = true;
ftpRequest.CreateMissingDirs = true;
ftpRequest.SetAuthentication(g_FTPUsername, g_FTPPassword);
ftpRequest.SetPort(g_FTPPort);
ftpRequest.SetProgressCallback(FtpProgressCallback);
ftpRequest.SetInputFile(filename);
ftpRequest.StartRequest();
} else{
LogMessage("FTP Uploads Disabled OR Filename was empty (no demo to upload). Change config to enable.");
}
public void FtpProgressCallback(System2FTPRequest request, int dlTotal, int dlNow, int ulTotal, int ulNow) {
char file[PLATFORM_MAX_PATH];
request.GetInputFile(file, sizeof(file));
if (strlen(file) > 0) {
PrintToServer("Uploading %s file with %d bytes total, %d now", file, ulTotal, ulNow);
}
}
public void FtpResponseCallback(bool success, const char[] error, System2FTPRequest request, System2FTPResponse response) {
if (success) {
char file[PLATFORM_MAX_PATH];
request.GetInputFile(file, sizeof(file));
if (strlen(file) > 0) {
LogMessage("Delete file after complete.");
}
}
}
And the output I get from the progress is the following:
Uploading demos/41_map1_de_mirage.dem file with 589824 bytes total, 0 now
Uploading demos/41_map1_de_mirage.dem file with 589824 bytes total, 131072 now
Uploading demos/41_map1_de_mirage.dem file with 589824 bytes total, 131072 now
Uploading demos/41_map1_de_mirage.dem file with 589824 bytes total, 131072 now
Followed by nothing else. Any idea as to why it's stalling? Thanks!
Hi,
It seems I'm running into an issue when trying to upload to an FTP server. Whenever I finish recording a demo, I want my plugin to upload it to a given server, but for some reason, it keeps stalling when the current uploaded bytes reach 131072. My code here is as shown, am I doing everything right?
And the output I get from the progress is the following:
Followed by nothing else. Any idea as to why it's stalling? Thanks!