System.Net.FtpWebRequest.UsePassive Property

Gets or sets the behavior of a client application's data transfer process.

Syntax

public bool UsePassive { get; set; }

Value

Documentation for this section has not yet been entered.

Remarks

Setting the FtpWebRequest.UsePassive property to true sends the "PASV" command to the server. This command requests the server to listen on a data port and to wait for a connection rather than initiate one upon receipt of a transfer command.

For a description of the behaviors that are specified using FtpWebRequest.UsePassive, see RFC 959, "File Transfer Protocol," Section 3.2, "Establishing Data Connections" and Section 4.1.2, "Transfer Parameter Commands," available at ..

Changing FtpWebRequest.UsePassive after calling the FtpWebRequest.GetRequestStream, FtpWebRequest.BeginGetRequestStream(AsyncCallback, object), FtpWebRequest.GetResponse, or FtpWebRequest.BeginGetResponse(AsyncCallback, object) method causes an InvalidOperationException exception.

If FtpWebRequest.UsePassive is set to true, the FTP server may not send the size of the file, and download progress can always be zero. If FtpWebRequest.UsePassive is set to false, a firewall can raise an alert and block the file download.

Requirements

Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0