I want to download A ftp directory which has its sub directories and files, I am using C# Ftpwebrequst.
Asked
Active
Viewed 2,745 times
-2
-
Is there any documentation? Have you read it? – bash.d Mar 22 '13 at 10:43
-
I know how to download a file, but i do not have idea how to download a folder – user2155670 Mar 22 '13 at 10:44
2 Answers
1
There is no way to directly download an entire folder in a single command. FTP
does not support this. You would need to enumerate through all files in the directory and their subdirectories and download files one-by-one.
Here is a thread from MSDN forums and here is the documentation on FtpWebRequest
-class from MSDN.

bash.d
- 13,029
- 3
- 29
- 42
0
I think you need something like this and you will have to recurse into each folder inidividually:
WebRequest request = WebRequest.Create(FTPServerDirectory);
request.Method = WebRequestMethods.Ftp.ListDirectory;
request.Credentials = new NetworkCredential(Username, Password);
request.GetResponse();

Damo
- 361
- 4
- 16
-
This Code will Listing the Directory, I want to download Directory – user2155670 Mar 22 '13 at 11:56