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

martin

Manurobate wrote:

I have exactly the same probleme. Could you please send me the development version of WinSCP to fix my problem ?

I'm sending you an email with a development version of WinSCP to the address you have used to register on this forum.
Manurobate

Hi there,

I have exactly the same probleme. Could you please send me the development version of WinSCP to fix my problem ?

If not, do you know when the fix will be release ?

Thanks for your help.
martin

Thanks for your feedback. We didn't set a date for the next release yet.
Speed103

The fix worked. I assume it will take a while to make it into the NuGet repo? I worked around it by using PutFiles but would like to change it back to PutFileToDirectory when I can since the syntax is simpler as your documentation has noted.
Speed103

Thanks Martin! I downloaded it and will give it a test soon and report back.
martin

Re: PutFileToDirectory fails with []

Thanks for your report.

This bug has been added to the tracker:
https://winscp.net/tracker/1931

I'm sending you an email with a development version of WinSCP to the address you have used to register on this forum.
Speed103

FYI...here's an example exception when trying to execute:
ftpSession.PutFileToDirectory(@"C:\Temp\test[4].txt", "/");

I get:

Unhandled Exception: WinSCP.SessionRemoteException: File or folder 'C:\Temp\test[[]4].txt' does not exist.

If I manually call RemotePath.EscapeFileMask(filename), it appears it converts my filename to the name in the exception, so I'm thinking PutFileToDirectory automatically calls that on the local file parameter, but is not escaping correctly with square brackets?
Speed103

PutFileToDirectory fails with []

I'm trying to use the PutFileToDirectory method in my C# program. However, it fails on files with square brackets in the name, like Test[4]. I assumed it was a filemask issue but I can't use RemotePath.EscapeFileMask because it only takes the original filename and then the remote directory. Also, the documentation seems to indicate:
You specify a path to the source file, not a wildcard, so you do not need to escape a literal file name.
Is this is a bug or am I missing something I need to set to send these files?

Thanks!