Uploading files creates a new directory on remote server

Advertisement

andrewkc69
Joined:
Posts:
6
Location:
Portland

Uploading files creates a new directory on remote server

Hello,
I am using the latest version of WinSCP, and I am using the .NET assemblies. The transfer protocol is SFTP. When I run the session.PutFiles, it doesn't matter what I specify as the remote folder, and here is what happens:

Let's say the local folder is called "D:\FTPFiles\" and I am using the TransferOptions.FileMask, which is set to "ODS*.txt". The remote folder is set up as "\from_idx\". I'm using the filemask because I only know what the prefix of the file name is. The file transfers fine, but the problem is that when I look on the ftp server I see the file in "\from_idx\FTPFiles\". It creates the directory under the remote directory.

I've tried a number of options, including making the remote directory "/". When I do that, it just creates the new directory in the root. The only way I have gotten this to work without creating a new directory is to name the local folder the same as the remote folder. In reality, I can't do this. From what I have read on your site, this should not be happening.

Am I doing something wrong, or is this a bug?

Thanks,
Andy

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,253
Location:
Prague, Czechia

Re: Uploading files creates a new directory on remote server

Use "D:\FTPFiles\*" for localPath.

Reply with quote

andrewkc69
Joined:
Posts:
6
Location:
Portland

Re: Uploading files creates a new directory on remote server

martin wrote:

Use "D:\FTPFiles\*" for localPath.

Thank you so much! That worked!!

Reply with quote

Advertisement

You can post new topics in this forum