This commit is contained in:
陆柯 2022-04-04 12:43:35 +08:00
parent e722b2dca2
commit 4ccfef98c9

View File

@ -20,7 +20,7 @@ module.exports = {
//const filename = `${req.path.replace(/^\/api\d*/, '')}_${_passtokenSource.uuid}_${Date.now()}${fileNameExtension}` // 如果最终 filename 含有 / (例如当 req.path 为 Who/todo则必须已经存在该目录否则在这里就出错不会进入下面流程。
cb(null, filename)
},
// req 被 multer 处理后req.file 为 { filename, originialname, path, mimetype, size }
// req 被 multer 处理后req.file 为 { destination, filename, originialname, path, mimetype, size }, 其中 path 包括了 destination 和 filename 的文件完整路径。
}),
// fileFilter:function(req, file, cb) {},
limits: { fileSize: 10485760 },