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.

Options
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)

Options

Topic review

andrewkc69

Re: Uploading files creates a new directory on remote server

Thank you so much! That worked!!
martin

Re: Uploading files creates a new directory on remote server

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

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