Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


Thank you. I changed the options and the error does not seem to appear anymore.

Uploading often does not work

I often get the following error:
Error code: 2
Error message from server: No such file
at TestAndSmileSQL.Classes.Ftps.WinScpUploadFileAsync(String sFtpAddress, String sRemotePath, String userName, String password, String sFile, String sClient, Protocol protocol) in C:\Prog\TestandSmileSQL_B95q\Classes\Ftps.cs:line 273
2024-05-28 21:49:09.180 +02:00 [INF] Err: WinScpUploadFile FtpAddress: RemotePath: /var/www/html/upload/800001419973.pdf Client. 100087 ex: WinSCP.SessionRemoteException: Transfer was successfully finished, but temporary transfer file '800001419973.pdf.filepart' could not be renamed to target file name '800001419973.pdf'. If the problem persists, you may try to turn off transfer resume support.
No such file or directory.

My code is:
SessionOptions sessionOptions = new SessionOptions {
    Protocol = protocol,
    HostName = sFtpAddress,
    UserName = userName,
    Password = password,
    FtpMode = FtpMode.Passive,
    PortNumber = iPort,
if (sessionOptions.Protocol == WinSCP.Protocol.Sftp) {
    sessionOptions.SshHostKeyFingerprint = Gets.GetTestAndSmileIniEntry("SshHostFingerprint=", sClient);
using (Session session = new Session()) {
    TransferOptions transferOptions = new();
    transferOptions.TransferMode = TransferMode.Binary;
    TransferOperationResult transferResult;
    transferResult = session.PutFiles(sFile, sRemotePath, false, transferOptions);

It occurs with the line transferResult.Check()

Thanks for any help.