+1 vote
by (130 points)

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

by (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
by (58.9k points)
edited by

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.

...