# Write File (Upload)

Uploads a local file, a 'PAWFileData' object or a byte array to the FTP server.

`LocalFilePath`, `File` and `Data` are alternative sources. If `LocalFilePath` is set, the file is read from disk.


---

### :arrow_left:**INPUT**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `ConnectionSettings` | [`PAWFtpConnectionSettings`](/doc/pawftpconnectionsettings-RcEVGpTNAG) | ✅Yes     | FTP connection details |
| `FtpFilePath` | `String` | ✅Yes     | Target file path on the FTP server |
| `LocalFilePath` | `String` | ❌No      | Local file path to upload |
| `File`    | `PAWFileData` | ❌No      | File object to upload (if the `LocalFilePath` input is empty) |
| `Data`    | `Byte[]` | ❌No      | File content (alternative to `LocalFilePath` / `File`) |
| `OverrideFile` | `Boolean` | ❌No      | Whether to overwrite the existing file (default: false) |


---

### :arrow_right:**OUTPUT**

| Parameter | Type | Description |
|-----------|------|-------------|
| `IsPutFileSuccessful` | `Boolean` | Upload success status |
| `PutFileMessage` | `String` | Status message or error detail |


---

### :arrow_down:**MISC**

| **Parameter** | **Type** | **Default** | **Description** |
|-----------|------|---------|-------------|
| `ThrowException` | `Boolean` | ❌No     | Throw exception on error (default: false) |