LongName is not accessible and User value is nothing using VB.NET / Studio 2013

+1 vote
asked Dec 3, 2015 by rwbisc (130 points)

SftpItem in SftpItemCollection contains a LongName having all the info I need but is not accessible and User always contains "Nothing".

commented Dec 4, 2015 by rwbisc (130 points)
Much thanks to Tomas Knopp. You have given me many options and I am taking the GetRaw approach to mirror conventional FTP to reduce the maintenance on some of our older applications.

1 Answer

0 votes
answered Dec 4, 2015 by Tomas Knopp (58,890 points)
edited Dec 4, 2015 by Tomas Knopp

It can happen that SftpItem.User property can be null, in case when the SFTP server does not return the user (e.g. the owner name on SFTP v4 servers and owner ID on SFTP v3 servers.)Returning it is however, not compulsory and some servers really do not do it. (as for instance our SFTP server at "test.rebex.net").

Please note that SftpItem.User has been deprecated. Please use SftpItem.Owner instead.

SftpItem.LongName is an internal property. What exactly do you need from the property?
An alternative is to call codeSftp.GetRawList method which returns the list of the same long names.

If you have a source code license you could make the internal property public easily.

...