Data Converter icon

Data Converter

Convert between various data formats - Base64, Binary, JSON, XML, YAML, CSV, HTML, and more

Overview

The node performs various string transformations and data conversions, including cleaning filenames by removing or replacing unsafe characters. The "Clean Filename" operation under the "String" resource specifically sanitizes input text to produce a filename safe for use in file systems by removing or replacing characters that might cause issues.

This operation is useful when you need to generate or sanitize filenames dynamically, for example:

  • Cleaning user-uploaded filenames before saving them to disk.
  • Generating safe filenames from arbitrary strings or titles.
  • Preparing filenames for cross-platform compatibility.

Properties

Name Meaning
Input Data The text string to be cleaned as a filename.
Binary Property Name (Optional) Name of the binary property for output if binary output is enabled (not used here).

Output

The output JSON contains a field named result which holds the cleaned filename string after processing. The node does not output binary data for this operation.

Example output JSON structure:

{
  "result": "cleaned-filename-string"
}

Dependencies

  • No external services or API keys are required.
  • The node uses internal utility functions for string operations.
  • No special environment variables or n8n configurations are needed.

Troubleshooting

  • Empty or unchanged output: If the input string is empty or already clean, the output will be the same or empty.
  • Unexpected characters remain: The cleaning function removes unsafe characters but may preserve some based on defaults; check if additional options (like keeping dots, hyphens, underscores) are needed.
  • Error messages: Errors during execution typically relate to invalid input types or missing required parameters. Ensure "Input Data" is provided as a string.

Links and References

Discussion