Creating remote folder error with permissions

Advertisement

Perhogan
Donor
Joined:
Posts:
10
Location:
Germany

Creating remote folder error with permissions

I need to create a remote folder on a sftp server and i use the workaround of creating it empty locally then "putFile" it to the server.

this works fine if i'm not specifying any permission, but it fails with the error -2146233079 operation is not valid due to the current status of the object. interesting enough it works with the normal files permissions.

here the code i use to assign permissions.

myFilePermissions.Text = "rwxrwxrwx"
myTransferOptions.FilePermissions = myFilePermissions
myTransferOptionsFolder.FilePermissions = myFilePermissions
    
myTransferOptionsFolder.TransferMode = TransferMode_Binary
myTransferOptions.TransferMode = TransferMode_Binary


Set transferResult = mySession.PutFiles(SourceFolder , RemoteFolder , False, myTransferOptionsFolder)
Set transferResult = mySession.PutFiles(SourceFolder & "/" & FileName , RemoteFolder , False, myTransferOptions)

if i comment the line number 3 everything works.

(i'm using VBA)

Reply with quote

Advertisement

Perhogan
Donor
Joined:
Posts:
10
Location:
Germany

Additional details

from a more detailed sebugging:

    1) remote file/folder does not exist
      a) I set permissions (no matter the value)
      myTransferOptions.FilePermissions = myFilePermissions
        i. I transfer a file: everything works properly
        ii. I transfer a folder: remote folder and subfiles are created with the e right permissions but i get the error from assembly
      b) I don't set permissions: everything works as expected
    2) remote file/folder exist
      a) I set permissions (no matter the value)
        i. I transfer a file: everything works properly
        ii. I transfer a folder: remote folder is not updated (permissions are not updated with the new value but the files contained in it are properly set)
      b) I don't set permissions: everything works as expected and permissions are updated

The log does not show any errors i can detect in any of the conditions. as the operation is executed i found a workaround but correcting the bug might be helpful.

Any help is appreciated

Reply with quote

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

Re: Additional details

Thanks for your detailed report.

Perhogan wrote:

The log does not show any errors i can detect in any of the conditions. as the operation is executed i found a workaround but correcting the bug might be helpful.
What log do you mean? The session log (Session.SessionLogPath) or debug log (Session.DebugLogPath)? If you haven't tried the debug log file, please do and post it here (or email to me).

Reply with quote

Advertisement

You can post new topics in this forum