Files Helper

The Files Helper piece in ZBrain Flow provides essential file management capabilities for your workflows. This versatile component allows you to read, create, and manipulate files within your automations. With Files Helper, you can process file contents, generate new files with custom data, convert file encodings, and verify file types - all crucial operations when building workflows that involve document processing, data transformation, or content generation.

How to Use Files Helper in ZBrain Flow?

  • Click on the '+' button in the Flow and search for Files Helper.

  • Select Files Helper.

  • Decide on the action you need, then select it. ZBrain Flow provides several options:

    • Read File – Reads content from an existing file.

    • Create File – Generates a new file with specified content.

    • Change File Encoding – Converts a file from one encoding format to another.

    • Check File Type – Analyzes a file to determine its MIME type and optionally filter by type.

How to Read a File?

Step 1: Select File

  • Use the ‘File’ field to add the file you want to read.

Step 2: Choose Output Format

  • From the ‘Output format’ dropdown, select how you want the file content to be returned:

    • Text - Returns the content as plain text.

    • Base64 - Returns the content encoded in Base64 format.

How to Create a File?

Step 1: Specify Content

  • In the ‘Content’ field, enter or paste the data you want to include in the file.

Step 2: Set File Name

  • Enter the desired ‘File name’ for your new file.

Step 3: Choose Encoding

  • From the ‘Encoding’ dropdown, select the character encoding for your file. The default is UTF-8, which works well for most text-based files.

How to Change File Encoding?

Step 1: Select Source File

  • Use the ‘Source file’ field to add the file whose encoding you want to change.

Step 2: Specify Source Encoding

  • From the ‘Source encoding’ dropdown, select the current encoding (e.g., UTF-16LE ) of your file.

Step 3: Set Output File Name

  • Enter the desired ‘Output file name’ for the converted file. You can use the same name as the source file or create a new name.

Step 4: Choose Output Encoding

  • From the ‘Output encoding’ dropdown, select the target encoding format (e.g., Binary).

How to Check File Type?

Step 1: Add File

  • Use the ‘File to Check’ field to add the file you want to analyze.

Step 2: Specify MIME Types

  • From the ‘Select MIME Types’ dropdown, choose specific file types to match against. You can select multiple MIME types to filter for specific formats.

Last updated