{"record":{"id":"9bdd2ba9ec97f991","repo":"AlistGo/alist","slug":"directory-separator-prohibited","errorCode":null,"errorMessage":"directory separator prohibited","messagePattern":"directory separator prohibited","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/chunker/util.go","lineNumber":74,"sourceCode":"\t\t}\n\t\tp = utils.FixAndCleanPath(p)\n\t\tif _, ok := seen[p]; ok {\n\t\t\treturn\n\t\t}\n\t\tseen[p] = struct{}{}\n\t\tpaths = append(paths, p)\n\t}\n\n\taddPath(d.RemotePath)\n\tfor _, line := range strings.Split(d.RemotePaths, \"\\n\") {\n\t\taddPath(line)\n\t}\n\treturn paths\n}\n\nfunc (d *Chunker) setChunkNameFormat(pattern string) error {\n\tif dir, _ := path.Split(pattern); dir != \"\" {\n\t\treturn errors.New(\"directory separator prohibited\")\n\t}\n\n\tnameStart, nameEnd, err := parseNameToken(pattern)\n\tif err != nil {\n\t\treturn err\n\t}\n\tchunkStart, chunkEnd, chunkWidth, err := parseChunkToken(pattern)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif nameStart > chunkStart {\n\t\treturn errors.New(\"name token must come before chunk token\")\n\t}\n\n\treDigits := \"[0-9]+\"\n\tif chunkWidth > 0 {\n\t\treDigits = fmt.Sprintf(\"[0-9]{%d,}\", chunkWidth)\n\t}","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/chunker/util.go#L56-L92","documentation":"The Chunker driver's chunk name format option (setChunkNameFormat) rejects any pattern containing a directory separator ('/' on the path side of path.Split). Chunk file names are flat: the driver derives the directory from the original file path and only the base name is templated, so '/' in the pattern is ambiguous and forbidden.","triggerScenarios":"Configuring the chunker storage with a chunk_name_format like '{name}/part-{chunk}' or any pattern where path.Split returns a non-empty dir portion. Raised immediately at driver Init/config validation, before any upload.","commonSituations":"Users migrating from other chunking tools that put chunks in subdirectories; copy-pasting a template that includes a path prefix; expecting 'dir/{name}_{chunk}' to create nested folders.","solutions":["Remove all '/' characters from chunk_name_format, e.g. use '{name}_{chunk:03}' instead of '{name}/{chunk:03}'","Keep any folder structure on the mount/remote path configuration, not in the chunk name pattern","If nested chunk dirs are a hard requirement, file a feature request — the format language intentionally cannot express it"],"exampleFix":"// before\nchunk_name_format: {name}/{chunk:03}\n// after\nchunk_name_format: {name}_{chunk:03}","handlingStrategy":"validation","validationCode":"// Validate before saving the chunker storage config\nif strings.Contains(chunkNameFormat, \"/\") || strings.Contains(chunkNameFormat, \"\\\\\") {\n    return fmt.Errorf(\"chunk name format must not contain directory separators: %q\", chunkNameFormat)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate chunk_name_format in your config pipeline before applying it to the storage","Keep chunk name templates flat — directories belong to the mount path, not the name format"],"tags":["chunker","configuration","validation","filesystem"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}