Issue Fixed
The issue was with the space on the FTP site. Had trouble catching hold of FTP site owners to verify and create more space.
Thanks a lot.
Thanks a lot.
Thanks a lot for the reply. But I never get any issue with FileZilla finishing the job. Even if I see some errors it seems to finish.
I also see a .filepart file on the remote server when the error happens. Does this mean it has issues renaming that .filepart file to what ever the real extension ?
.filepart
) closes. So WiSCP won't even try to rename the file.
transferOptions = new TransferOptions();
transferOptions.ResumeSupport.State = TransferResumeSupportState.Off;
remoteSession.SynchronizeDirectories(SynchronizationMode.Remote, srcPath, dstPath, true,false, SynchronizationCriteria.Time, transferOptions);
private void SyncFolders(string srcPath, string dstPath, bool bCreateDestFolder = false)
{
if (Directory.Exists(srcPath))
{
if (bCreateDestFolder)
{
if (!remoteSession.FileExists(dstPath))
{
remoteSession.CreateDirectory(dstPath);
}
}
remoteSession.SynchronizeDirectories(SynchronizationMode.Remote, srcPath, dstPath, true);
}
}
private void ReleaseSoftwareToLfoundary()
{
UpdateStatus("Updating LFoundry FTP Site ..Please wait");
WinSCP.SessionOptions sessionOpts = new SessionOptions();
sessionOpts.HostName = "sftp.lfoundry.com";
sessionOpts.PortNumber = 7788;
sessionOpts.UserName = "username";
sessionOpts.Password = "password";
sessionOpts.Protocol = Protocol.Sftp;
sessionOpts.GiveUpSecurityAndAcceptAnySshHostKey = true;
sessionOpts.TimeoutInMilliseconds = 500000;
bFTPFileTransferError = false;
remoteSession = new Session();
remoteSession.FileTransferred += new FileTransferredEventHandler(remoteSession_FileTransferred);
remoteSession.Open(sessionOpts);
int nCount = 0;
while (remoteSession.Opened == false)
{
Thread.Sleep(200);
nCount++;
if (nCount == 25)//wait for 5 secs
{
itemsFailed++;
AppendToLog("Connecting FTP server Failed");
return;
}
}
try
{
srcPath = PublishFolder + @"ProjectFiles\" + VersionNumber;
dstPath = @"ProjectFiles/" + VersionNumber;
SyncFolders(srcPath, dstPath, true);
}
catch(Exception _ex)
{
};
}
private void remoteSession_FileTransferred(object sender, TransferEventArgs e)
{
if (e.Error != null)
{
bFTPFileTransferError = true;
string message = string.Format("Upload of {0} failed: {1}", e.FileName, e.Error);
AppendToLog(message);
}
else
{
string message = string.Format("Trasfered file {0} To FTP Site", e.FileName);
AppendToLog(message);
}
}