# File Upload & Download

## Download a File

Download a file from the FTP server.

```bash
nxc ftp <ip> -u <username> -p <password> --get <filename>
```

Expected Results:

```bash
nxc ftp 10.10.176.246 -u frank -p D2xc9CgD --get ftp_flag.thm
FTP         10.10.176.246   21     10.10.176.246    [*] Banner: (vsFTPd 3.0.3)
FTP         10.10.176.246   21     10.10.176.246    [+] frank:D2xc9CgD
FTP         10.10.176.246   21     10.10.176.246    [+] Downloaded: ftp_flag.thm
```

## Upload a File

Upload a file to the FTP server providing you have relevant permissions. The first argument after `--put` will be the location of the file on your local machine to upload. The second argument determines the path and filename:

```bash
nxc ftp <ip> -u <username> -p <password> --put <local-file> <remote-path>
```

Expected Results:

```bash
nxc ftp 10.10.176.246 -u frank -p D2xc9CgD --put test.txt test.txt
FTP         10.10.176.246   21     10.10.176.246    [*] Banner: (vsFTPd 3.0.3)
FTP         10.10.176.246   21     10.10.176.246    [+] frank:D2xc9CgD
FTP         10.10.176.246   21     10.10.176.246    [+] Uploaded: test.txt to test.txt
```


---

# 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://www.netexec.wiki/ftp-protocol/get-and-put-files.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.
