How to send arbitrary ftp commands in C#

Posted by cchampion on Stack Overflow See other posts from Stack Overflow or by cchampion
Published on 2010-02-23T19:35:36Z Indexed on 2010/06/10 10:32 UTC
Read the original article Hit count: 321

Filed under:
|

I have implemented the ability to upload, download, delete, etc. using the FtpWebRequest class in C#. That is fairly straight forward.

What I need to do now is support sending arbitrary ftp commands such as

quote SITE LRECL=132 RECFM=FB
or 
quote SYST

Here's an example configuration straight from our app.config:

<!-- The following commands will be executed before any uploads occur -->
<extraCommands>
     <command>quote SITE LRECL=132 RECFM=FB</command>
</extraCommands>

I'm still researching how to do this using FtpWebRequest. I'll probably try WebClient class next. Anyone can point me in the right direction quicker? Thanks!

UPDATE: I've come to that same conclusion, as of .NET Framework 3.5 FtpWebRequest doesn't support anything except what's in WebRequestMethods.Ftp.*. I'll try a third party app recommended by some of the other posts. Thanks for the help!

© Stack Overflow or respective owner

Related posts about c#

Related posts about ftp