diff --git a/index.js b/index.js index 53378a9..266cfb2 100644 --- a/index.js +++ b/index.js @@ -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 },