SFTP PUTFILE ISSUE

0 votes
asked Jul 25, 2011 by NISHIKANT GOUTAM (120 points)
edited Jul 25, 2011

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
answered Jul 25, 2011 by Martin Vobr (12,820 points)
edited Jul 25, 2011

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?

...