It might be easier if I just upload my code... (let me know if you still want the log; I don't think it will show anything other than the error message I copied verbatim). The code is written as a method now; might change it later to a class...
------------------------- code starts here ------------------------
//--------------------- code to upload a file -----------------------
public int uploadFile(string[] args)
{
Logger log = Logger.GetLogger(typeof(mainForm));
// assign args to make it clear
string userID = args[0];
string password = args[1];
string hostURL = args[2];
string fileName = args[3];
string directory = args[4];
Logger.CurrentLevel = Level.ALL;
FTPClient ftp = new FTPClient();
ftp.RemoteHost = hostURL;
try
{
// connect
log.Info("Connecting");
ftp.Connect();
if (ftp.IsConnected == true)
{
// login
log.Info("Logging in");
ftp.Login(user, password);
// set up passive ASCII transfers
log.Debug("Setting up passive, ASCII transfers and TransferBufferSize");
ftp.ConnectMode = FTPConnectMode.PASV;
ftp.TransferType = FTPTransferType.ASCII;
ftp.TransferBufferSize = 2048;
// change directory if necessary
log.Info("changing directory");
if (directory != null && directory.Length > 0)
ftp.ChDir(directory);
// copy file to server
string[] shortFilename = fileName.Split('\\');
lbUploadStatus.Items.Insert(0, "starting transfer of " + shortFilename[3]);
lbUploadStatus.Refresh();
log.Info("Putting file: " + fileName + " shortFilename: " + shortFilename[3]);
ftp.Put(fileName, shortFilename[3]); // local path, remote filename
// Shut down client
log.Info("Quit issued...");
ftp.Quit();
}
}
catch (Exception e)
{
log.Debug(e.Message, e);
MessageBox.Show("File transfer error: " + e.Message, "Prager, Software", MessageBoxButtons.OK, MessageBoxIcon.Error);
return -1;
}
return 0;
}
----------------------------------- code ends here --------------------------------