Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I am using FtpwebRequest to upload files to FTP.

I am using
WebRequestMethods.Ftp.ListDirectory
i.e. NLST FTP command to check if directory exists on FTP or not.

But i get randomly 550 as FTP response code for this command even though directory is exists on FTP.

I am using Windows Server R2 and FTP 7.5.

what is best way to check if folder exists on FTP?

Thanks in advance,
Pushkar

What I have tried:

I also tried with following command:

WebRequestMethods.Ftp.ListDirectoryDetails
ie.e LIST ftp command. But still gets same response randomly.
Posted
Updated 1-Feb-18 9:17am
Comments
Richard Deeming 1-Feb-18 15:27pm    
You might have better luck using a proper FTP library, rather than the basic support they managed to shoehorn in to the WebRequest class.

FluentFTP[^] looks quite promising.

1 solution

Maybe you can find the answer here: How to check that a specified folder exists on ftp server[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900