dot net process is succesfull but file is not getting copied to destination (no error)

Advertisement

swamytech
Guest

dot net process is succesfull but file is not getting copied to destination (no error)

We are trying to copy the file from local system to SFTP site. Process is successful but file is not reaching destination location.

Here is the code:
try
{
SessionOptions sessionOptions = new SessionOptions
{
Protocol = Protocol.Sftp,
HostName = XYZ //Testsftpsite.com
UserName = XYZ
Password = XYZ
PortNumber = XYZ
SshHostKeyFingerprint = XYZ
};
'ALL XYZ are replaced with actual values

using (Session session = new Session())
{
session.Open(sessionOptions);
bool blConnectionStatus = session.Opened;
TransferOptions transferOptions = new TransferOptions();
transferOptions.TransferMode = TransferMode.Binary;
transferOptions.FilePermissions = null;
transferOptions.PreserveTimestamp = false;
transferOptions.ResumeSupport.State = TransferResumeSupportState.Off;
TransferOperationResult transferResult;
transferResult = session.PutFiles(LOCALFilePath,RemoteFilePath,false,transferOptions);
transferResult.Check();

}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}

Using WinSCP 5.7.4.0 on Windows 8 / 64 bit system.

Please help us to resolve the issue

Thanks
  • code.txt (1.28 KB, Private file)
Description: Code

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,506
Location:
Prague, Czechia

Re: dot net process is succesfull but file is not getting copied to destination (no error)

Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate log file, set Session.SessionLogPath. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

swamytech
Guest

dot net process is succesfull but file is not getting copied to destination (no error)

Thanks for the support. I'm attaching the code details which we have used
  • Status_Code.txt (2.31 KB, Private file)
Description: Enabled the SessionLog and attached code which we have used to tranfer the file

Reply with quote

swamytech
Guest

dot net process is succesfull but file is not getting copied to destination (no error)

Thanks for the support. I'm attaching the details of session log file which you have requested.
  • Log.txt (10.01 KB, Private file)
Description: Session log file details

Reply with quote

martin
Site Admin
martin avatar

Re: dot net process is succesfull but file is not getting copied to destination (no error)

The file is transferred. It's possible that you have wrong syntax of remote path, but I cannot tell as you have obfuscated the path. Make sure the path ends with slash or file name. Or there's some server-side process that removes the file as soon as it is uploaded.

Reply with quote

Advertisement

You can post new topics in this forum