# FtpOperation

Calling this method performs a FTP operation, by either copying or moving files.

### **Method Name:**

FtpOperation

### **Payload:**

The direct command requires the following properties:

* **FtpConfigId**: Name of the FTP configuration as listed in the module twin
* **FtpServerFolder**: Name of the FTP folder to do an operation from
* **FilePatterns**: File pattern
* **FileFilter**: File filter
* **BlobContainer**: Blob container to use
* **BlobFolder**: Blob folder to use
* **FtpOperationType**: Valid FTP operation types are ListFtpFiles, UploadToFtp, DownloadFromFtp and SynchronizeFtpFolder. SynchronizeFtpFolder is a FtpOperation that downloads a folder or file from FTP Server to Local Storage on Edge device. Once all files has been downloaded, all files can be Moved on the FtpServerFolder to FtpExportedFolder to avoid re-download on next cron trigger. Optionally these files can also be removed, once they have been downloaded to Edge.
* **FileOperation**: Valid operations are Copy, Move, Delete and Rename.
* **PostSyncFtpFilesProcess**: Valid options are MoveSyncedFtpFilesToFtpExportedFolder (After having synced files, move all files on the remote FTP server to the FtpExportedFolder), DeleteSyncedFtpFiles (After having synced files, Delete all downloadd files on the remote FTP server to avoid re-download) or KeepFilesOnFtp (After having synced files, Dont Delete or Move any File. Warning: This may result in re-download of all files, next time the FTP syncjob triggers)
* **FtpExportedFolder**: FTP output folder

### **Return value**

The direct command returns an OperationResult that indicates either success or failure.


---

# 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://docs.tricloudnexus.io/edge/nexus-modules/data-connector-modules/filetransfermodule/direct-commands/ftpoperation.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.
