954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

FTP Help

Hello everyone:

The problems is the following. I'm creating an specific program to upload to FTP on C#. That works perfectly. My problem is that i want to give the user the ability to change folders but so far I don't seem to find anything over the internet.

Can someone help me on this posting some code on how to get specifically folders on the FTP and not any other file. I want to put that info on a combobox, but that is not a problem. The thing is that I cannot find a way to do so. I tried GOOGLe, I tried several dll, libraries and all that but no success.

Hope someone can help.

Thanks in advance

darkelflemurian
Light Poster
43 posts since Dec 2010
Reputation Points: 10
Solved Threads: 2
 

Create a FtpWebRequest and set the Method property to what you want. Then call GetResponse() to get whatever data you need. Set the Method again, call GetResponse() again, etc. until you are done.

Momerath
Nearly a Senior Poster
3,384 posts since Aug 2010
Reputation Points: 1,232
Solved Threads: 558
 
Create a FtpWebRequest and set the Method property to what you want. Then call GetResponse() to get whatever data you need. Set the Method again, call GetResponse() again, etc. until you are done.

First of all, thanks for your quick response.

The thing is that i don't see how can I filter folders. that is my problem. Cause I'm able to get the list of files but no folders. and what I need is to get the folders only.

darkelflemurian
Light Poster
43 posts since Dec 2010
Reputation Points: 10
Solved Threads: 2
 

I don't have an FTP server to test with so I'm kinda flying blind here, but you tried WebRequestMethods.Ftp.ListDirectory and WebRequestMethods.Ftp.ListDirectoryDetails?

If you do, can you post the response you get back from each?

There are also plenty of projects on the net for an FTP client written in C# (they use Sockets instead of FtpWebRequest).

Momerath
Nearly a Senior Poster
3,384 posts since Aug 2010
Reputation Points: 1,232
Solved Threads: 558
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: