You probably retrieved the FtpItem by the GetList()
method. This method represents the MLSD (or LIST) command which doesn't contain absolute path information. This is simple and fast method intended to retrieve items in the current remote directory.
To retrieve advanced information about items, use the complex GetItems()
method like this:
var list = client.GetItems("*", TraversalMode.NonRecursive);
If you want to retrieve only files, use it like this:
var list = client.GetItems("*", TraversalMode.MatchFilesShallow);
Alternatively, you can still use the GetList()
method and combine client.GetCurrentDirectory()
with FtpItem.Name
.