Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

RTavernier

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
RTavernier

Ok I will try that. I come back to you if it works.
martin

So do not set the permissions (transferOptions.FilePermissions = New FilePermissions(300)), if you do not have permissions to set them.

You may also need to disable preserving of a timestamp.

This error is well documented:
https://winscp.net/eng/docs/message_preserve_time_perm
RTavernier

Here is the display I get when it throw an exception (Message and toString of the exception).

Sorry It is in french. Do you want me to translate it ?

Cordialy,

Rémi
martin

Re: Unable File Permission Exception in VB.NET

What's the exception exactly?
RTavernier

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)