Archived Forum Post

Index of archived forum posts

Question:

Uploading multiple files fails with write-only permissions on sftp server

Aug 09 '17 at 12:30

Goodmorning,

we're using a script to upload multiple files to an sftp server. This scripts works exept with one sftp server, where we only have write-only permissions. It will upload the first file, but after that all file uploads fails.

We make use of UploadFileByName. Please find below logfile. It looks like it tries to open the file. Does anybody know why it tries to open the file and if we can prevent this?

 localFileSize: 0
  sftpOpenFile:
    remotePath: //in/test4.txt
    access: writeOnly
    createDisposition: createTruncate
    v3Flags: 0x1a
   Sent FXP_OPEN
    StatusResponseFromServer:
      Request: FXP_OPEN
      InformationReceivedFromServer:
        StatusCode: 3
        StatusMessage: Permission denied
      --InformationReceivedFromServer
    --StatusResponseFromServer
    retryFilepath: .//in/test4.txt
    remotePath: .//in/test4.txt
    access: writeOnly
    createDisposition: createTruncate
    v3Flags: 0x1a
    Sent FXP_OPEN
    StatusResponseFromServer:
      Request: FXP_OPEN
      InformationReceivedFromServer:
        StatusCode: 3
        StatusMessage: Permission denied
      --InformationReceivedFromServer
    --StatusResponseFromServer
  --sftpOpenFile
  Failed to open file.
--uploadFileByName
Failed.   --UploadFileByName

--ChilkatLog


Answer

Your remote path looks strange: //in/test4.txt

Also, when an SFTP server replies with "permission denied", it means the remote file path one is trying to open or create is something where the SSH user account does not have permission. This is not something Chilkat can help solve (because we're not your system administrator). The server system administrator should check the user account, it's permissions, the filesystem directory permissions, etc. Perhaps a file of the same name already exists and you don't have permission to overwrite, etc.