# <get>

[This is preliminary documentation and subject to change.]

Gets a particular file from a URL source.

Options include verbose reporting and timestamp based fetches.

Currently, only HTTP and UNC protocols are supported. FTP support may be added when more pluggable protocols are added to the System.Net assembly.

The `usetimestamp` option enables you to control downloads so that the remote file is only fetched if newer than the local copy. If there is no local copy, the download always takes place. When a file is downloaded, the timestamp of the downloaded file is set to the remote timestamp.

Note: This timestamp facility only works on downloads using the HTTP protocol.

### Parameters

Attribute | Type | Description | Required
--- | --- | --- | ---
dest | file | The file where to store the retrieved file. | True
src | string | The URL from which to retrieve a file. | True
httpproxy | string | Deprecated. If inside a firewall, proxy server/port information Format: {proxy server name}:{port number} Example: proxy.mycompany.com:8080 | False
ignoreerrors | bool | Deprecated. Log errors but don't treat as fatal. The default is false. | False
timeout | int | The length of time, in milliseconds, until the request times out. The default is `100000` milliseconds. | False
usetimestamp | bool | Conditionally download a file based on the timestamp of the local copy. HTTP only. The default is false. | False
failonerror | bool | Determines if task failure stops the build, or is just reported. The default is true. | False
if | bool | If true then the task will be executed; otherwise, skipped. The default is true. | False
unless | bool | Opposite of `if`. If false then the task will be executed; otherwise, skipped. The default is false. | False
verbose | bool | Determines whether the task should report detailed build log messages. The default is false. | False

### Nested Elements:

#### <proxy>

The network proxy to use to access the Internet resource.

#### </proxy>

#### <credentials>

The network credentials used for authenticating the request with the Internet resource.

#### </credentials>

#### <certificates>

The security certificates to associate with the request.

#### </certificates>

### Examples

- Gets the index page of the NAnt home page, and stores it in the file `help/index.html` relative to the project base directory.

      <get src="http://nant.sourceforge.org/" dest="help/index.html" />

- Gets the index page of a secured web site using the given credentials, while connecting using the specified password-protected proxy server.

      <get src="http://password.protected.site/index.html" dest="secure/index.html">
          <credentials username="user" password="guess" domain="mydomain" />
          <proxy host="proxy.company.com" port="8080">
              <credentials username="proxyuser" password="dunno" />
          </proxy>
      </get>

### Requirements

Assembly: NAnt.Core (0.91.3881.0)