# 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.
