Hi,

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.

Regards,

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.