Skip to content

File

The File Operator enables creating and managing files within the system. It provides functionality for converting text content to files and downloading files from URLs, making them available for further processing within the application.

  • Converting text or JSON data to files
  • Downloading files from external URLs
  • Creating temporary files for processing
  • Storing generated content as files
  • Preparing data for export or download
  • Creating files from API responses
  • Storing configuration data as files

Converts text content to a file with the given name and content type.

  • name (string): The name to give to the created file
  • contentType (string): The MIME type of the file (e.g., “text/plain”, “application/json”)
  • content (string): The text content to be stored in the file

Returns an object containing information about the created file, including:

  • id (string): The unique identifier of the file
  • name (string): The file name
  • contentType (string): The content type of the file
  • size (long): The file size in bytes
  • organizationId (string): The organization ID associated with the file
{
"name": "config.json",
"contentType": "application/json",
"content": "{\"key\": \"value\", \"enabled\": true}"
}

Downloads a file from the specified URL and stores it in the system.

  • url (string): The URL to download the file from
  • contentType (string, optional): The MIME type of the file. If not provided, the system will attempt to determine the content type from the downloaded content.

Returns a FileDto object containing information about the downloaded file, including:

  • id (string): The unique identifier of the file
  • name (string): The file name (derived from the URL path)
  • contentType (string): The content type of the file
  • size (long): The file size in bytes
  • organizationId (string): The organization ID associated with the file
{
"url": "https://example.com/documents/report.pdf",
"contentType": "application/pdf"
}
  • If the content type is not specified and cannot be determined automatically, “application/octet-stream” will be used as the default.
  • The file name is extracted from the last segment of the URL path.
  • The system handles the download process and stores the file content securely.