File upload creates directory

Advertisement

frankblack
Joined:
Posts:
2

File upload creates directory

WinSCP 5.7.3.5438, Windows 8.1 Pro, Scripting with Eclipse, protocol scp

I am using WinSCP for synchronizing files, but whenever a PDF file has to be synchronized, a directory with that name is created on remote. As I recognize it at the moment, PDF is the only file format causing this error. Maybe there are other file formats.

[exec] Starting WinSCP...
[exec] winscp> option batch abort
[exec] batch abort
[exec] reconnecttime 120
[exec] winscp> option confirm off
[exec] confirm off
[exec] winscp> open scp://dummy@dummy.dummy.de:***@dummy.dummy.de
[exec] winscp> option transfer binary
[exec] transfer binary
[exec] winscp> mkdir "/root/www/path/to/folder/pdf/thepdffile.pdf"
[exec] winscp> exit
[exec] WinSCP finished without errors.

[exec] Starting WinSCP...
[exec] winscp> option batch abort
[exec] batch abort
[exec] reconnecttime 120
[exec] winscp> option confirm off
[exec] confirm off
[exec] winscp> open scp://dummy@dummy.dummy.de:***@dummy.dummy.de
[exec] winscp> option transfer binary
[exec] transfer binary
[exec] winscp> synchronize both -criteria=either "C:\local\path" "/root/www/path/to/folder/pdf"
[exec] Using configured transfer settings different from factory defaults.
[exec] Comparing...

Any idea what I am doing wrong? Thanks in advance for any assistance.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,506
Location:
Prague, Czechia

Re: File upload creates directory

You are explicitly creating a directory named thepdffile.pdf:

mkdir "/root/www/path/to/folder/pdf/thepdffile.pdf"

Reply with quote

frankblack

Solved

Thanks for your answer prikryl. Indeed the script I use was to blame (https://rays-blog.de/2012/05/05/94/use-winscp-to-upload-files-using-eclipses-autobuild-feature/). Strangely the script "thinks" a PDF is a directory. So I inserted an "if" for preventing this behaviour.

Reply with quote

Advertisement

You can post new topics in this forum