Documentation
¶
Overview ¶
Package fsname sanitizes arbitrary (including Cyrillic) strings into safe filesystem path segments and file name stems.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileStem ¶
FileStem turns an uploaded file's name into a URL-friendly stem: transliteration, lower case and whitespace → "-": "My Poster.JPG" → "my-poster". The extension is dropped; fallback is returned when nothing usable remains.
func NormalizeFolderSegment ¶
NormalizeFolderSegment transliterates Cyrillic to Latin, maps spaces to underscores, keeps [a-z0-9_-], collapses repeats. Result length is capped at 64 characters.
func SanitizeImageStem ¶
SanitizeImageStem turns the original file base name into a safe stem for storage: transliterates Cyrillic, keeps ASCII letters (case preserved) and digits, allows _ and -; spaces become underscores; other runes become underscores; collapses repeats. Empty or invalid result becomes "image". Length is capped at 200 runes.
Types ¶
This section is empty.