FilePermission on Upload file FTP protocol

Advertisement

calatubo
Joined:
Posts:
8

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)

Reply with quote E-mail

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,551
Location:
Prague, Czechia

Re: FilePermission on Upload file FTP protocol

Your code looks correct.

Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate log file, set Session.SessionLogPath. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

Advertisement

You can post new topics in this forum