> ## Documentation Index
> Fetch the complete documentation index at: https://docs.specterops.io/llms.txt
> Use this file to discover all available pages before exploring further.

# upload

> Upload a file to the target machine by selecting a file from your computer.

## Summary

Upload a file to the target machine by selecting a file from your computer.

* Needs Admin: False
* Version: 1
* Author: @its\_a\_feature\_

### Arguments

#### file

* Description: file to upload
* Required Value: True
* Default Value: None

#### remote\_path

* Description: /remote/path/on/victim.txt
* Required Value: True
* Default Value: None

## Usage

```
upload
```

## MITRE ATT\&CK Mapping

* T1132
* T1030
* T1105

## Detailed Summary

This function uses API calls to chunk and transfer a file down from Mythic to the agent, then uses API calls to write the file out to disk:

```javascript theme={null}
if(typeof data == "string"){
    data = convert_to_nsdata(data);
}
if (data.writeToFileAtomically($(file_path), true)){
    return "file written";
}
```

After successfully writing the file to disk, the agent will report back the final full path so that it can be tracked within the UI.
