forked from mirror/MCSM-Daemon
Feat: Set variable type for request.file
This commit is contained in:
parent
c23648f201
commit
5764763587
@ -63,10 +63,10 @@ router.post("/upload/:key", async (ctx) => {
|
||||
const uploadDir = mission.parameter.uploadDir;
|
||||
const cwd = instance.config.cwd;
|
||||
|
||||
const file = ctx.request.files.file as any;
|
||||
if (file) {
|
||||
const file = ctx.request.files.file;
|
||||
if (file && !(file instanceof Array)) {
|
||||
// Confirm storage location
|
||||
const fullFileName = file.name as string;
|
||||
const fullFileName = file.name;
|
||||
const fileSaveRelativePath = path.normalize(path.join(uploadDir, fullFileName));
|
||||
|
||||
// File name special character filtering (to prevent any cross-directory intrusion)
|
||||
|
Loading…
Reference in New Issue
Block a user