Unable File Permission Exception in VB.NET

Advertisement

RTavernier
Guest

Unable File Permission Exception in VB.NET

Hi everyone !

I would like to know how to disable the FilePermission Exceptions everytime I'm transfering a file using vb.net


I can transfer the file fine but it throw the permission error when I check. And I would like the check to not throw this error especialy.

I'm using winscp Beta. (last one)

The code where i encounter the problem :

<Creation of the session...>
<Connexion OK...>

Dim transferOptions As New TransferOptions
transferOptions.TransferMode = TransferMode.Binary
transferOptions.FilePermissions = New FilePermissions(300)
Dim transferResult As TransferOperationResult

Dim nomfichier As String = System.IO.Path.GetFileName(a_FileName)

transferResult = sessions.PutFiles(<MyFile>, <PathOnServer>, False, transferOptions)

transferResult.Check()

sessions.Close()

Return True
Catch e As Exception
MsgBox("error sftp : " & e.Message & vbCrLf)

Reply with quote

Advertisement

Advertisement

RTavernier
Guest

Thanks a lot Martin for your help,

The solution you gave me is working. I simply forgot to disable preserving the timestamp.

For the permissions I firstly try by not setting them but the system was still giving me the exception.

By doing both, it's now working perfectly fine.

Thanks a lot again

RT

Reply with quote

Advertisement

You can post new topics in this forum