Mariya Atanasova's Blog

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:
http://msdn.microsoft.com/en-us/library/system.net.webrequestmethods.ftp_members(VS.80).aspx
and
http://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:
http://blogs.msdn.com/mariya/archive/2006/11/07/ftpwebrequest-and-the-pwd-size-and-mdtm-methods.aspx

Published Saturday, July 26, 2008 1:45 AM by mariya

Comments

 

Network Class Library Team (System.Net) said:

This is a current compile of the team's existing blogs on FtpWebRequest. I am going to update it periodically

July 25, 2008 9:23 PM
Anonymous comments are disabled

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker