# File$download

### Fil&#x65;**$**<mark style="color:purple;">**download**</mark>**(***path=getwd(), \*, overwrite=FALSE***)** → str

Downloads the file to the specified path, or the current working directory if no path is specified.&#x20;

{% hint style="info" %}
If you are downloading multiple files from a table or query result, you'll see significantly better performance (due to parallelization) by calling [Table$download\_files](broken://pages/IpBT9h5ejdZaj7Oc7v5m) or [Query$download\_files](broken://pages/kPaSx4A3uQqj9a1BzGCv).
{% endhint %}

### **Parameters:**

**`path` :&#x20;*****str, default getwd()***\
The path for where to download the file. If the path represents a directory that already exists, or ends in a path separator (e.g., `/`), the path is assumed to be a directory, and the file will be downloaded into that directory (using the name of the file on Redivis). If the path doesn't end in a directory, the path is assumed to include the name of the downloaded file. If the path specifies any (sub)directories that do not exist, they'll automatically be created. If no path is specified, the file is downloaded to the current working directory.

**`overwrite` :&#x20;*****bool, default FALSE***\
Whether to overwrite any existing file if the same file already exists at the download path.

### **Returns:**

**str** (the path of the downloaded file)

### Examples

```r
t <- redivis$table("demo.example_data_files:yz1s:v1_3.example_file_types:4c10")
f <- t$file("bogota.tiff")

f$download() # download to current working directory
f$download("new_name.tiff") # download to current working directory, and rename to new_name.tiff
f$download("/some/path/") # downloaded as /some/path/bogota.tiff
f$download("/some/path/new_name.tiff") # downloaded as /some/path/new_name.tiff
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.redivis.com/api/client-libraries/redivis-r/reference/file/fileusddownload.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
