# downloadfile

![Parralels](https://www.parallels.com/static/pl/fileadmin/res/img/navigation/pl-logo-dk.png)

## AppserverClient Command Line Interface

### downloadfile

download a file from the remote session.

**Category: Sessions**

```
AppServerClientCLI downloadfile -id session:545567 [-remotefile c:\test\receive.txt] [-localfile c:\test\send.txt] [-autoclosewnd] [-waitforcomplete [20]]  
```

### Arguments

* **`id (mandatory)`** Specify a session ID to use for the file transfer.
* **`localfile (optional)`** Specify the file path where to store the downloaded file. If omitted the user will be prompted to choose it.
* **`remotefile (optional)`** Specify the file to download. If omitted the user will be prompted to choose it.
* **`autoclosewnd (optional)`** When specified, the file transfer window will close when ready.
* **`waitforcomplete (optional)`** When specified with a time value in seconds, this command will return when the transfer is ready, has failed, or has timed out.

### Return codes:

ok - Command was successful\
NotAvailable - Communication with the client backend failed, ensure that the client is running\
InvalidArgs - Some arguments are missing or invalid\
InvalidId - Invalid connection, object or session ID\
Exception - System problem

### Examples:

AppServerClientCLI downloadfile -id session:545567\
AppServerClientCLI downloadfile -id session:545567 -remotefile c:\test\send.txt\
AppServerClientCLI downloadfile -id session:545567 -remotefile c:\test\send.txt -localfile c:\test\receive.txt\
AppServerClientCLI downloadfile -id session:545567 -remotefile c:\test\send.txt -localfile c:\test\receive.txt -autoclosewnd\
AppServerClientCLI downloadfile -id session:545567 -remotefile c:\test\send.txt -localfile c:\test\receive.txt -autoclosewnd -waitforcomplete\
AppServerClientCLI downloadfile -id session:545567 -remotefile c:\test\send.txt -localfile c:\test\receive.txt -autoclosewnd -waitforcomplete 20

### Notes:

Please note that the API returns when the file transfer is initiated and not when it is complete.

### See also:

[sendkeys](https://docs.parallels.com/landing/ras-windows-cli-guide/v20/commands/sendkeys)\
[sendmouseevents](https://docs.parallels.com/landing/ras-windows-cli-guide/v20/commands/sendmouseevents)\
[sendkeyboardevents](https://docs.parallels.com/landing/ras-windows-cli-guide/v20/commands/sendkeyboardevents)\
[getsessionsinfo](https://docs.parallels.com/landing/ras-windows-cli-guide/v20/commands/getsessionsinfo)\
[disconnectsession](https://docs.parallels.com/landing/ras-windows-cli-guide/v20/commands/disconnectsession)\
[uploadfile](https://docs.parallels.com/landing/ras-windows-cli-guide/v20/commands/uploadfile)
