I would like to know whether the given path is a directory or file in FTP folder.

I have tried some code like this.

FtpWebRequest request = (FtpWebRequest)FtpWebRequest.Create(pServerURL + pRemoteFilePathNm);
request.Credentials = new NetworkCredential(pUserName, pPassword);
request.Method = WebRequestMethods.Ftp.ListDirectory;
FtpWebResponse response = (FtpWebResponse)request.GetResponse();

But i didnt find whether it is a directory or file..

Can any one help?

Thanks in advance for help.


Sravanthi Ch

It depends on your intentions (your request.Method).
If you are listing a directory, it should be a directory.
If you are downloading a file, it should be a file.