File
Introduction
The File library in Automate provides actions to automate various file-related operations within workflows. This library enables users to create, copy, delete, and move files seamlessly.
The purpose of the File library is to streamline file management tasks by providing easy-to-use actions for creating, copying, deleting, and moving files.
What is File?
The File component within Automate allows users to perform file operations directly within their automation workflows. It provides a set of actions to interact with files, making it easier to handle file creation, copying, deletion, and moving.
Key Features
Create:
Create a new file at a specified path.
Copy:
Copy an existing file to another location.
Delete:
Delete a specified file.
Move:
Move a file to a different folder.
How To Use Action
Create
Description: The Create action is used to create a new file at a specified path.
Usage:
File Path:
Enter or select the path of the file to be created.
Example:
C:\Program Files\NewFile.docx
Copy
Description: The Copy action is used to make a copy of an existing file.
Usage:
Source File:
Select the file to be copied.
Destination Path:
Select or enter the path where the copied file will be placed.
Check "Overwrite existing files" if needed.
Specify the desired file size (optional).
Delete
Description: The Delete action is used to delete a specified file.
Usage:
File Path:
Select the path of the file to be deleted.
Move
Description: The Move action is used to move a file to a different folder.
Usage:
Source File Path:
Select the file to be moved.
Destination Folder Path:
Select or enter the path of the destination folder.
Get File Properties
Description and Purpose
The Get File Properties action allows Autom Mate users to retrieve detailed metadata and properties of a specific file stored in Mate Drive. This action is useful for inspecting file attributes such as name, size, MIME type, permissions, and modification dates, which can be used for conditional logic, logging, or file validation within a workflow.
By providing the file path and assigning the output to a variable, users can make file-aware decisions across the automation process.
Usage Instructions
Provide File Path
File Path (Required): Enter the full path of the file stored in Mate Drive for which properties should be retrieved. Example:
Assign Output Variable
Assign file properties to variable (Required):
Select an object-type variable (e.g., resp
) to store the file properties returned by the action.
Execute and Review
Run the action. After execution, the output variable will contain the file’s properties such as size, format, creation date, last modified date, permissions, and more.
Inputs
File Path
The full Mate Drive file path to inspect (e.g., mate:/example.docx
).
Outputs
Output Variable (object
)
Contains all properties of the given file such as name, path, MIME type, size, permissions, and timestamps.
Example Output
Rename
Description and Purpose
The File - Rename action allows Autom Mate users to rename an existing file stored in MateDrive. This action is useful for dynamically changing file names during workflows, such as appending dates, adding version numbers, or organizing files based on their content or context.
By providing the source file path and the new file name, users can automate file renaming tasks without manual intervention, ensuring efficient file management.
Usage Instructions
Provide File Path
File Path (Required): Enter the full path of the file that you want to rename. Example:
This is the path of the existing file in Mate Drive that will be renamed.
Specify New File Name
New File Name (Required): Enter the new name you want to assign to the file. Example:
Ensure that the new file name includes the proper extension (e.g., .png
, .txt
, .pdf
) to maintain the file's correct format.
Execute and Review
Run the action. After execution, the file at the provided path will be renamed to the new name specified. The change will be reflected in the Mate Drive file system.
Inputs
File Path
The full path of the existing file to rename (e.g., mate:/oldFileName.png
).
New File Name
The new name to assign to the file (e.g., newFileName
).
Outputs
File Path
The path of the renamed file in Mate Drive (e.g., mate:/newFileName.png
).
Example
File Path:
New File Name:
Output: The file
mate:/oldFileName.png
will be renamed tomate:/newFileName.png
after the action is executed.
Unzip
Description and Purpose
The File - Unzip action allows Autom Mate users to extract the contents of a ZIP file stored in Mate Drive. This action is useful for automating the extraction of compressed files, enabling easy access to the files inside the archive. Users can choose to extract the contents to the same path or specify a different destination folder.
By providing the path of the ZIP file and the desired extraction destination, users can streamline file management and processing tasks.
Usage Instructions
Provide Zip File Path
Zip File Path (Required): Enter the full path of the ZIP file you want to extract. Example:
This is the path to the ZIP file stored in Mate Drive that will be unzipped.
Specify Destination Folder
Destination: Choose where you want to extract the files.
Extract to same path: Extracts the contents into the same directory as the ZIP file.
Extract to given path (Required): Specify a different folder where the files will be extracted. Example:
Overwrite Existing Folder
Overwrite an existing folder: Enable this option if you want to replace the contents of an existing folder with the extracted files.
Enabling this option will remove any existing files in the destination folder and replace them with the extracted files.
Assign Folder Path to Variable
Assign folder path to variable (Required):
Select a string-type variable (e.g., NewFilePath
) to store the full path of the destination folder where the files were extracted.
Example:
This allows referencing the extracted folder's location in subsequent workflow steps.
Execute and Review
Run the action. After execution, the contents of the ZIP file will be extracted to the specified folder, and the folder path will be stored in the chosen output variable.
Inputs
Zip File Path
The path of the ZIP file to be extracted (e.g., mate:/archive (2).zip
).
Destination
The folder path where the ZIP file should be extracted (either the same path or a new one).
Overwrite Existing Folder
Enable to overwrite existing folder contents with the extracted files.
Assign Folder Path to Variable
Select a string variable (e.g., NewFilePath
) to store the destination path.
Outputs
New File Path
The path of the folder where the files were extracted (e.g., mate:/unzip
).
Example
Zip File Path:
Destination:
Output Variable (
NewFilePath
): The files from the archive will be extracted to the foldermate:/unzip
, and the output variable will store this path.
Zip
Description and Purpose
The File - Zip action allows Autom Mate users to compress files and directories into a ZIP archive within Mate Drive. This action is useful for organizing multiple files or folders into a single compressed file for easier storage, transfer, or backup. Users can specify the file to be zipped and define the destination and zip file name.
Usage Instructions
Provide File Path
File Path (Required): Enter the full path of the file or directory to be compressed into a ZIP archive. Example:
This is the path of the file or folder to be zipped.
Specify Zip Name
Zip Name: Enter the desired name for the resulting ZIP file. Example:
By default, if no name is provided, the folder name will be used for the ZIP archive. Make sure the name ends with .zip
to indicate it's a compressed file.
Choose Destination
Destination: Select where you want to save the ZIP file.
Extract to same path: The ZIP file will be saved in the same directory as the original file or folder.
Extract to given path: Specify a different folder to store the ZIP file. Example:
Overwrite Existing Folder
Overwrite an existing folder: Enable this option if you want to replace any existing file or folder with the same name in the destination.
Enabling this option will overwrite the existing ZIP file or folder in the destination with the new one.
Assign File Path to Variable
Assign file path to variable (Required):
Select a string-type variable (e.g., ziptest
) to store the full path of the newly created ZIP file.
Example:
This allows you to reference the created ZIP file’s location in subsequent actions.
Execute and Review
Run the action. After execution, the specified file(s) or folder will be compressed into a ZIP file, and the path of the ZIP file will be stored in the output variable.
Inputs
File Path
The path of the file or folder to compress into a ZIP archive.
Zip Name
The name to assign to the resulting ZIP file.
Destination
The folder path where the ZIP file should be saved.
Overwrite Existing Folder
Enable to overwrite an existing file with the same name.
Assign File Path to Variable
Select a string variable to store the file path of the created ZIP archive.
Outputs
New File Path
The path of the created ZIP file (e.g.,mate:/archives/ZipTest.zip
).
Example
File Path:
Zip Name:
Destination:
Output Variable (
ziptest
): The filemate:/test.txt
will be compressed into the ZIP filemate:/archives/ZipTest.zip
, and the output variableziptest
will store this path.
Additional Tips
Last updated
Was this helpful?