Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
FTP Session LoggingDownloads: MS Windows Visual C/C++ Libraries Linux/CentOS C/C++ Libraries MAC OS X C/C++ Libraries Solaris C/C++ Libraries C++ Builder Libraries FreeBSD C++ Libraries HP-UX C++ Libraries BlackBerry QNX C++ Libraries How to log the raw commands and responses set to/from an FTP server (i.e. the session log). // If something does not seem to work, the best course of action
// is to turn on session logging, capture the session log, and then
// send it to support@chilkatsoft.com. Providing a sample code-snippet
// helps.
void FtpSessionLogging(void)
{
CkFtp2 ftp;
ftp.UnlockComponent("anything for 30-day trial");
ftp.put_Hostname("ftp.chilkatsoft.com");
ftp.put_Username("***");
ftp.put_Password("***");
// non-passive (active) connections are most likely to work if firewalls are present.
ftp.put_Passive(false);
// Turn on session logging.
ftp.put_KeepSessionLog(true);
// Connect to the FTP server and login.
bool success = ftp.Connect();
if (!success)
{
// The error log is separate from the raw FTP session log..
ftp.SaveLastError("ftpLog.txt");
// This is were we get the session log, which contains the raw
// command and responses for all conversations with the FTP server
// after session logging was turned on.
CkString sessionLog;
ftp.get_SessionLog(sessionLog);
sessionLog.saveToFile("sessionLog.txt","iso-8859-1");
return;
}
success = ftp.PutFile("testUpload.dat","testUpload.dat");
if (!success)
{
// The error log is separate from the raw FTP session log..
ftp.SaveLastError("ftpLog.txt");
// This is were we get the session log, which contains the raw
// command and responses for all conversations with the FTP server
// after session logging was turned on.
CkString sessionLog;
ftp.get_SessionLog(sessionLog);
sessionLog.saveToFile("sessionLog.txt","iso-8859-1");
return;
}
ftp.Disconnect();
}
|
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.