Home Forums .NET libraries Xceed SFTP/FTP for .NET File Existence

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #21446 |

    Can someone show me an example of how to check for a file’s existence on the server?  I would like for the function to except the full filename.

    Thanks!

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Ray (had 621 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi, 

    You can check ftp raw commands(CWD, LIST etc.)  characteristics on the web.

    As it shows,  you can follow the steps blow.

    1. Change the current directory until your target directory is current.  -> FtpClient#ChangeCurrentFolder()

    2. List up and  enumerate the files of the current.  -> FtpClient#GetFolderContents()

        GetFolderContents can accept a file mask and returns a FtpItemInfoList collection.

       the FtpItemInfoList collection contains FtpItemInfo items.  So you can detect whether the target FtpItemInfo is in it.

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Noriyuki (had 120 views)

    User (Old forums)
    Member
    Post count: 23064

    Thanks!

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Ray (had 736 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.