Compare commits

...

3 Commits

Author SHA1 Message Date
QuietlyChan
a3283ff3bb Merge 4134770586 into e6b87f89ec 2025-03-09 10:37:15 +08:00
ItzCrazyKns
e6b87f89ec feat(sample-config): add custom openai model name 2025-03-08 20:08:27 +05:30
QuietlyChan
4134770586 fix(uploads): Resolve the issue of garbled non-ASCII character filenames. 2025-03-03 10:21:29 +08:00
2 changed files with 7 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ API_KEY = ""
[MODELS.CUSTOM_OPENAI] [MODELS.CUSTOM_OPENAI]
API_KEY = "" API_KEY = ""
API_URL = "" API_URL = ""
MODEL_NAME = ""
[MODELS.OLLAMA] [MODELS.OLLAMA]
API_URL = "" # Ollama API URL - http://host.docker.internal:11434 API_URL = "" # Ollama API URL - http://host.docker.internal:11434

View File

@@ -75,6 +75,12 @@ router.post(
} }
const files = req.files['files'] as Express.Multer.File[]; const files = req.files['files'] as Express.Multer.File[];
// Fixed the garbled issue of non-ASCII character filenames.
files.forEach((file) => {
file.originalname = Buffer.from(file.originalname, 'latin1').toString(
'utf8',
);
});
if (!files || files.length === 0) { if (!files || files.length === 0) {
res.status(400).json({ message: 'No files uploaded' }); res.status(400).json({ message: 'No files uploaded' });
return; return;