ftos.files.move
IMPORTANT!
Starting with v24.3.0, this is renamed from moveFileToFolder to ftos.files.move.
Starting with v24.3.0, this is renamed from moveFileToFolder to ftos.files.move.
Moves a file to a known folder.
This is a business logic method for business service components.
Syntax
Copy
function ftos.files.move(sourceFileName : string, destinationFolderName : WorkflowKnownFolders): void;
| Parameter | Type | Description |
|---|---|---|
sourceFileName
|
string | Path to the file including the file extension. The file should be stored in a known folder, eg. Import/test1.csv. |
knownFolder
|
WorkflowKnownFolders | Name of the known folder:
|
Examples
In this example, we recover the BankingProduct_EntityStatusSettings_fe45fd7a-1a56-43c6-82b5-020b0c83941d.xlsx file from the $RecycleBin.
Copy
ftos.files.move('$RecycleBin/BankingProduct_EntityStatusSettings_fe45fd7a-1a56-43c6-82b5-020b0c83941d.xlsx', '');
In this example:
- We read all the files in the temp folder in an array called files. See ftos.files.listFolder for details on how to retrieve all the file names from a known folder.
- We iterate over each file an move it to the $RecycleBin folder.
Copy
let files = ftos.files.listFolder('temp');
for (i = 0; i < files.length; i++){
ftos.files.move(files[i], '$RecycleBin')
}