Merge 678424b2d2 into 1ba82cf1b2
This commit is contained in:
commit
2ef00dd9b6
2 changed files with 5 additions and 5 deletions
|
|
@ -24,7 +24,7 @@ export const download = new Elysia()
|
|||
const jobId = decodeURIComponent(params.jobId);
|
||||
const fileName = sanitize(decodeURIComponent(params.fileName));
|
||||
|
||||
const filePath = `${outputDir}${userId}/${jobId}/${fileName}`;
|
||||
const filePath = `${outputDir}${userId}/${sanitize(jobId)}/${fileName}`;
|
||||
return Bun.file(filePath);
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -25,12 +25,12 @@ export const upload = new Elysia().use(userService).post(
|
|||
if (body?.file) {
|
||||
if (Array.isArray(body.file)) {
|
||||
for (const file of body.file) {
|
||||
const santizedFileName = sanitize(file.name);
|
||||
await Bun.write(`${userUploadsDir}${santizedFileName}`, file);
|
||||
const sanitizedFileName = sanitize(file.name);
|
||||
await Bun.write(`${userUploadsDir}${sanitizedFileName}`, file);
|
||||
}
|
||||
} else {
|
||||
const santizedFileName = sanitize(body.file["name"]);
|
||||
await Bun.write(`${userUploadsDir}${santizedFileName}`, body.file);
|
||||
const sanitizedFileName = sanitize(body.file["name"]);
|
||||
await Bun.write(`${userUploadsDir}${sanitizedFileName}`, body.file);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue