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

ZincAlloy

So not a WinSCP issue...

So this turned out to be an IPS that decided the CLI was not trusted (apparently after allowing the initial connection). Never would have guessed...

Thanks anyway, and sorry for wasting anyone's time.
martin

Re: Upload works in GUI, in command line upload file created with zero bytes

Please attach complete session log files both from GUI and scripting.
ZincAlloy

Upload works in GUI, in command line upload file created with zero bytes

So if I upload a text file via the GUI, everything works fine. When I try the same thing via command line, the file gets created on FTP server with zero bytes (almost as if the client creates a zero-byte file and then tries to update it with the data, but the update fails).

The command line I am using is:
put -transfer=automatic -nopermissions -nopreservetime -resumesupport=off blah.txt


The key part of the log follows; authentication etc. is fine:

. 2019-02-28 09:47:18.431 Getting real path for '/'
> 2019-02-28 09:47:18.431 Type: SSH_FXP_REALPATH, Size: 10, Number: 6160
< 2019-02-28 09:47:18.525 Type: SSH_FXP_NAME, Size: 23, Number: 6160
. 2019-02-28 09:47:18.525 Real path is '/'
. 2019-02-28 09:47:18.525 Trying to open directory "/".
> 2019-02-28 09:47:18.525 Type: SSH_FXP_LSTAT, Size: 10, Number: 6407
< 2019-02-28 09:47:18.619 Type: SSH_FXP_ATTRS, Size: 21, Number: 6407
. 2019-02-28 09:47:18.619 Getting current directory name.
. 2019-02-28 09:47:18.619 Startup conversation with host finished.
< 2019-02-28 09:47:18.619 Script: Session started.
. 2019-02-28 09:47:18.619 File: 'blah.txt' [2019-02-28T13:42:44.855Z] [167200]
. 2019-02-28 09:47:18.619 Copying "blah.txt" to remote directory started.
. 2019-02-28 09:47:18.619 Ascii transfer mode selected.
. 2019-02-28 09:47:18.619 Opening remote file.
> 2019-02-28 09:47:18.619 Type: SSH_FXP_OPEN, Size: 34, Number: 6659
< 2019-02-28 09:47:18.716 Type: SSH_FXP_STATUS, Size: 33, Number: 6659
< 2019-02-28 09:47:18.716 Status code: 2, Message: 6659, Server: File not found, Language: en
> 2019-02-28 09:47:18.716 Type: SSH_FXP_LSTAT, Size: 18, Number: 6919
< 2019-02-28 09:47:18.810 Type: SSH_FXP_ATTRS, Size: 29, Number: 6919
* 2019-02-28 09:47:18.810 (ETerminal) No such file or directory.
* 2019-02-28 09:47:18.810 Error code: 2
* 2019-02-28 09:47:18.810 Error message from server (en): File not found
. 2019-02-28 09:47:18.810 Asking user:
. 2019-02-28 09:47:18.810 Cannot overwrite remote file '/blah.txt'.$$
. 2019-02-28 09:47:18.810
. 2019-02-28 09:47:18.810 Press 'Delete' to delete the file and create new one instead of overwriting it.$$ ("No such file or directory.
. 2019-02-28 09:47:18.810 Error code: 2
. 2019-02-28 09:47:18.810 Error message from server (en): File not found")
< 2019-02-28 09:47:18.810 Script: Cannot overwrite remote file '/blah.txt'.
< 2019-02-28 09:47:18.810 Script: No such file or directory.
< 2019-02-28 09:47:18.810 Error code: 2
< 2019-02-28 09:47:18.810 Error message from server (en): File not found
* 2019-02-28 09:47:18.810 (ESkipFile) Cannot overwrite remote file '/blah.txt'.$$
* 2019-02-28 09:47:18.810
* 2019-02-28 09:47:18.810 Press 'Delete' to delete the file and create new one instead of overwriting it.$$
* 2019-02-28 09:47:18.810 No such file or directory.
* 2019-02-28 09:47:18.810 Error code: 2
* 2019-02-28 09:47:18.810 Error message from server (en): File not found
. 2019-02-28 09:47:18.810 Copying finished: Transferred: 0, Elapsed: 0:00:52, CPS: 0/s
. 2019-02-28 09:47:18.810 Script: Failed
. 2019-02-28 09:47:18.810 Script: Exit code: 1
. 2019-02-28 09:47:18.810 Closing connection.
. 2019-02-28 09:47:18.810 Sending special code: 12
. 2019-02-28 09:47:18.810 Sent EOF message


I've been through multiple forum posts, the FAQ, Stack Overflow, etc. Any help greatly appreciated.