validateFilename(filename) Last updated: 29. Sep 2025

Validates that a filename contains only allowed characters.

Parameters

Name Type Description
filename string

Returns

True if valid, false if invalid filename.

Example

Code example (JS)

JS is normal JavaScript either running in the browser or on the Docly™ server.
let x = "validfile.txt";
let result = docly.validateFilename(x); // will be true

let invalid = " not\t valid";
result = docly.validateFilename(invalid); // will be false