Skip to main content

sanitize_filename

Function sanitize_filename 

Source
pub fn sanitize_filename(name: &str) -> Result<String>
Expand description

Strip path traversal components and return only the final filename.

Removes .. components, path separators, control characters, and NUL bytes. Unicode filenames are preserved.