0 votes
by (120 points)
edited

Hi ,

I am using sftp putfile method to upload the files to mine sftp location. I am passing the parameters localfilePathwithFileName and filename as remotepath. Putfile method is appending some unique 10 digit number at the end of the filename mentioned by me.

How can I avoid renamming of file.

Thanks, NishiKant

Applies to: Rebex SFTP

1 Answer

0 votes
by (13.3k points)
edited

Hi,

it looks strange. I've tried to reproduce it by following code and received a clean upload with no appended digits. Could you please try similar code on your place?

Sftp sftp = new Sftp();
try
{
    sftp.Connect("hostname");
    sftp.Login("username", "password");
    sftp.PutFile(@"c:\temp\file.txt", "MyRemoteFileName.txt");

    // list files on remote directory
    SftpItemCollection items = sftp.GetList();

    Console.WriteLine("Remote files:");
    foreach (SftpItem item in items)
    {
        Console.WriteLine(item.Name);                   
    }
}
finally
{
    sftp.Disconnect();
}

It produced following output:

Remote files:
MyRemoteFileName.txt

If the problem persists could you please create a communication log file as described at http://www.rebex.net/kb/logging.aspx and either edit your question to include the log or send it to support@rebex.net for analysis?

...