Set transferOptions.FilePermissions via VB (Express)
As the subject says, I want to change the filepermissions - for the files to be transferred - via a script, and I always receive an error when I try to set the parameter.
The error: Object reference not set to an instance of an object.
Is this a bug, or what am I missing?
Part of the script (which works, as long as don't use the line transferOptions.FilePermissions.GroupWrite = True
There is also a try/catch, but this isn't given in in the code, I also updated to the latest version (5.1.7), but it doesn't make a difference
The error: Object reference not set to an instance of an object.
Is this a bug, or what am I missing?
Part of the script (which works, as long as don't use the line transferOptions.FilePermissions.GroupWrite = True
Using session As Session = New Session
' Connect
session.Open(sessionOptions)
' Upload files
Dim transferOptions As New TransferOptions
transferOptions.TransferMode = TransferMode.Ascii
'******** The line below generates an error ***********
transferOptions.FilePermissions.GroupWrite = True
Dim transferResult As TransferOperationResult
transferResult = session.PutFiles(path_orig, strUploadDirRemote, False, transferOptions)
' Throw on any error
transferResult.Check()
' Print results
Dim transfer As TransferEventArgs
For Each transfer In transferResult.Transfers
Me.RTbox.AppendText("Upload of '" & transfer.FileName & "' succeeded" & vbCrLf)
Next
End UsingThere is also a try/catch, but this isn't given in in the code, I also updated to the latest version (5.1.7), but it doesn't make a difference