> For the complete documentation index, see [llms.txt](https://docs.zerve.ai/guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zerve.ai/guide/canvas-view/files/download-files.md).

# Download Files

## **Download into File system**

Python Syntax for downloading file a file into file system

```python
import requests

# URL of the Iris dataset
url = "https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data"
file_path = "./iris_dataset.csv"  # Desired local file path

# Send an HTTP GET request to the URL
response = requests.get(url)

# Check if the request was successful
if response.status_code == 200:
    # Open a local file with write-binary ('wb') mode
    with open(file_path, 'wb') as file:
        # Write the content to the local file
        file.write(response.content)
    print(f"File downloaded successfully and saved as {file_path}")
else:
    print(f"Failed to download the file. HTTP status code: {response.status_code}")

```

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIQKNeqjEeOp9UwUcB9R9%2Fuploads%2FSB7sx1W4K3oecjuHy1fr%2FScreen%20Recording%202025-03-27%20at%205.53.47%E2%80%AFPM.mp4?alt=media&token=fd510b45-896a-41d7-8a06-eb21bfd477f5>" %}
Downloading file using Python
{% endembed %}

R Syntax for downloading file a file into file system

```r
# URL of the Iris dataset
url <- "https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data"
file_path <- "./iris_dataset.csv"  # Desired local file path

# Download the file
download.file(url, file_path, method = "auto")

# Check if the file was downloaded
if (file.exists(file_path)) {
  cat("File downloaded successfully and saved as", file_path, "\n")
} else {
  cat("Failed to download the file.\n")
}

```

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIQKNeqjEeOp9UwUcB9R9%2Fuploads%2Fnbdq1T4PtqHMrdVqk65A%2FMy%20Movie%201.mp4?alt=media&token=a803aba9-6bc9-4d45-87a3-3df6d0ba9002>" %}
Downloading file using R
{% endembed %}

## **Download from File system**

The files from file system can also be downloaded into the local machine.

<figure><img src="/files/SGVAuyTH175yGVA1OawZ" alt=""><figcaption><p>Download file without code</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.zerve.ai/guide/canvas-view/files/download-files.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
