Topic "File Permissions"

Author Message
mwinner
[View user's profile]

Joined: 2012-02-12
Posts: 2
Does anybody know why, when I use:

Dim transferOptions As New TransferOptions
transferOptions.TransferMode = TransferMode.Binary

transferOptions.FilePermissions.Numeric = 775
Dim transferResult As TransferOperationResult

I get an error pointing to: transferOptions.FilePermissions.Numeric = 775, saying "Object reference not set to an instance of an object."? It works perfectly without it, but I need certain permissions set. No matter how I set such permissions, it doesn't seem to work.

Thanks!
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
TransferOptions.FilePermissions defaults to Null.
So you need to create an instance of FilePermissions first:
Code:
Dim transferOptions As New TransferOptions
Set transferOptions.FilePermissions = New FilePermissions

Then, you probably wanted to do:
Code:
transferOptions.FilePermissions.Octal = "755"

_________________
Martin Prikryl
mwinner
[View user's profile]

Joined: 2012-02-12
Posts: 2
Wonderful!

Thanks a lot!
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License