Action File System
Sanitize Filename
Removes or replaces invalid characters from a string to make it safe for use as a filename or path component. Handles characters that are invalid in file systems (quotes, pipes, etc.) and characters that would change path meaning (slashes, backslashes).
Node IDSanitizeFilenameAction
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
Input String inputString | textarea | Yes | — | The string to sanitize for use as a filename |
Replacement Character replacement | string | No | _ | Character to replace invalid characters with (default: underscore) |
Preserve Spaces preserveSpaces | boolean | No | true | If true, spaces are preserved. If false, spaces are replaced with the replacement character. |
Maximum Length maxLength | integer | No | 255 | Maximum length for the sanitized filename (most file systems support up to 255 characters) |
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
Execute input0 | object | No | An execution signal to trigger the action |
Outputs
| Output | Type | Identifier | Description |
|---|---|---|---|
Sanitized String output0 | string | sanitized_filename | The sanitized filename safe for use in file systems |