Partager via


FtpWebRequest commands and how they work

Currently, the user is allowed to specify the following commands: APPE, DELE, RETR, SIZE LIST, NLST, MKD, PWD. RMD, RENAME, STOR, and STOU. This is done by setting the FtpWebRequest.Metod property to one of the values of the WebRequestMetods.Ftp.Members type. The default one is RETR. For more details on this check our documentation:
https://msdn.microsoft.com/en-us/library/system.net.webrequestmethods.ftp_members(VS.80).aspx
and
https://msdn.microsoft.com/en-us/library/system.net.webrequestmethods.ftp.aspx

Example: FtpWebRequest.Method = WebRequesMethods.Ftp.ListDirectoryDetails will send the LIST ftp command on the wire and return you a detailed list of the contents of the specified folder.

The result of executing the command on your ftp server will be in the ResponseStream returned by FtpWebResponse, except for the PWD, SIZE and MDTM methods. For the result of thos commands check the corresponding  FtpWebRequest properties as specified here:
https://blogs.msdn.com/mariya/archive/2006/11/07/ftpwebrequest-and-the-pwd-size-and-mdtm-methods.aspx

Comments

  • Anonymous
    July 25, 2008
    This is a current compile of the team's existing blogs on FtpWebRequest. I am going to update it periodically