I am able to upload a document to FTP server via WinSCP GUI, with warnings, however I cannot do this via simple script
open sftp:
put * -nopermissions
exit
In log I can see that the username and password is accepted fine however the same credentials that work in GUI do not work via script.
< 2023-11-21 15:57:32.681 Script: Authenticating with pre-entered password.
. 2023-11-21 15:57:32.681 Sent password
. 2023-11-21 15:57:34.477 Access granted
. 2023-11-21 15:57:34.477 Opening main session channel
. 2023-11-21 15:57:34.508 Opened main channel
. 2023-11-21 15:57:34.508 Started a shell/command
< 2023-11-21 15:57:34.508 Script: Authenticated.
. 2023-11-21 15:57:34.508 --------------------------------------------------------------------------
. 2023-11-21 15:57:34.508 Using SFTP protocol.
. 2023-11-21 15:57:34.508 Doing startup conversation with host.
< 2023-11-21 15:57:34.508 Script: Starting the session...
> 2023-11-21 15:57:34.508 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2023-11-21 15:57:36.512 Type: SSH_FXP_VERSION, Size: 5, Number: -1
. 2023-11-21 15:57:36.539 Binary transfer mode selected.
. 2023-11-21 15:57:36.539 Checking existence of file.
> 2023-11-21 15:57:36.539 Type: SSH_FXP_LSTAT, Size: 43, Number: 775
< 2023-11-21 15:57:37.116 Type: SSH_FXP_STATUS, Size: 38, Number: 775
< 2023-11-21 15:57:37.116 Status code: 3, Message: 775, Server: Access denied, Language: US-ASCII
. 2023-11-21 15:57:37.116 Checking existence of partially transferred file.
> 2023-11-21 15:57:37.116 Type: SSH_FXP_LSTAT, Size: 52, Number: 1031
< 2023-11-21 15:57:37.210 Type: SSH_FXP_STATUS, Size: 38, Number: 1031
< 2023-11-21 15:57:37.210 Status code: 3, Message: 1031, Server: Access denied, Language: US-ASCII
. 2023-11-21 15:57:37.210 Opening remote file.
> 2023-11-21 15:57:37.210 Type: SSH_FXP_OPEN, Size: 68, Number: 1283
< 2023-11-21 15:57:37.290 Type: SSH_FXP_STATUS, Size: 38, Number: 1283
< 2023-11-21 15:57:37.290 Status code: 3, Message: 1283, Server: Access denied, Language: US-ASCII
> 2023-11-21 15:57:37.290 Type: SSH_FXP_LSTAT, Size: 52, Number: 1543
< 2023-11-21 15:57:37.368 Type: SSH_FXP_STATUS, Size: 38, Number: 1543
< 2023-11-21 15:57:37.368 Status code: 3, Message: 1543, Server: Access denied, Language: US-ASCII
* 2023-11-21 15:57:37.368 (ETerminal) Permission denied.
* 2023-11-21 15:57:37.368 Error code: 3
* 2023-11-21 15:57:37.368 Error message from server (US-ASCII): Access denied
. 2023-11-21 15:57:37.368 Asking user:
. 2023-11-21 15:57:37.368 Cannot create remote file '/.csv.filepart'. ("Permission denied.
. 2023-11-21 15:57:37.368 Error code: 3
. 2023-11-21 15:57:37.368 Error message from server (US-ASCII): Access denied")
< 2023-11-21 15:57:37.368 Script: Cannot create remote file '/.csv.filepart'.
< 2023-11-21 15:57:37.368 Script: Permission denied.
< 2023-11-21 15:57:37.368 Error code: 3
< 2023-11-21 15:57:37.368 Error message from server (US-ASCII): Access denied
. 2023-11-21 15:57:37.368 Answer: Abort
* 2023-11-21 15:57:37.368 (ESkipFile) Cannot create remote file '/.csv.filepart'.
* 2023-11-21 15:57:37.368 Permission denied.
* 2023-11-21 15:57:37.368 Error code: 3
* 2023-11-21 15:57:37.368 Error message from server (US-ASCII): Access denied
. 2023-11-21 15:57:37.368 Copying finished: Transferred: 0, Elapsed: 0:00:00, CPS: 0/s
. 2023-11-21 15:57:37.368 Script: Failed
. 2023-11-21 15:57:37.368 Script: Exit code: 1
. 2023-11-21 15:57:37.368 Closing connection.
. 2023-11-21 15:57:37.368 Sending special code: 1
. 2023-11-21 15:57:37.826 Session sent command exit status 0
. 2023-11-21 15:57:37.826 Main session channel closed
. 2023-11-21 15:57:37.826 All channels closed
I found this stack overflow post but I'm confident my account has access to create files, otherwise I wouldn't be able to do it via GUI, dragging a file into the FTP server folder.