FilePermission on Upload file FTP protocol
Hi, sorry for trouble, I'm trying to upload a file with the follow routine ad the file permission are not set as I want.
Can somebody help me to understand where is the mistake? (The permission on the file are the default, as when I not set any file permission). Thanks.
Dim myFilePermission As New FilePermissions
myFilePermission.UserExecute = True
myFilePermission.UserRead = True
myFilePermission.UserWrite = True
myFilePermission.OtherExecute = True
myFilePermission.OtherRead = True
myFilePermission.OtherWrite = True
myFilePermission.GroupExecute = True
myFilePermission.GroupRead = True
myFilePermission.GroupWrite = True
Dim myTransferOptions As New TransferOptions()
myTransferOptions.TransferMode = TransferMode.Binary
myTransferOptions.FilePermissions = myFilePermission
Using mySession As Session = New Session
mySession.Open(mySessionOptions)
If (mySession.FileExists(remotePath + remoteFile)) Then
Dim day As String = Format(Now(), "dd_MM_yyyy") + "_"
l.WriteLine("Rename of " + remotePath + remoteFile + " to " + remotePath + day + remoteFile, clsLogger.sign._INFO)
mySession.MoveFile(remotePath + remoteFile, remotePath + day + remoteFile)
End If
Dim transferResult As TransferOperationResult
transferResult = mySession.PutFiles(local, remotePath + remoteFile, False, myTransferOptions)
Can somebody help me to understand where is the mistake? (The permission on the file are the default, as when I not set any file permission). Thanks.
Dim myFilePermission As New FilePermissions
myFilePermission.UserExecute = True
myFilePermission.UserRead = True
myFilePermission.UserWrite = True
myFilePermission.OtherExecute = True
myFilePermission.OtherRead = True
myFilePermission.OtherWrite = True
myFilePermission.GroupExecute = True
myFilePermission.GroupRead = True
myFilePermission.GroupWrite = True
Dim myTransferOptions As New TransferOptions()
myTransferOptions.TransferMode = TransferMode.Binary
myTransferOptions.FilePermissions = myFilePermission
Using mySession As Session = New Session
mySession.Open(mySessionOptions)
If (mySession.FileExists(remotePath + remoteFile)) Then
Dim day As String = Format(Now(), "dd_MM_yyyy") + "_"
l.WriteLine("Rename of " + remotePath + remoteFile + " to " + remotePath + day + remoteFile, clsLogger.sign._INFO)
mySession.MoveFile(remotePath + remoteFile, remotePath + day + remoteFile)
End If
Dim transferResult As TransferOperationResult
transferResult = mySession.PutFiles(local, remotePath + remoteFile, False, myTransferOptions)