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

Author Message
swamytech

Guest


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

Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
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.
swamytech

Guest


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

swamytech

Guest


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

martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
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.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License