u
This commit is contained in:
parent
6d9de894c3
commit
bd64df212f
3
index.js
3
index.js
@ -10,8 +10,7 @@ module.exports = {
|
||||
storage: multer.diskStorage({
|
||||
destination (req, file, cb) {
|
||||
// 如果直接提供字符串,multer会负责创建该目录。如果提供函数,你要负责确保该目录存在。
|
||||
const folder = wo?.envi?.uploadroot // 目录是相对于本应用的入口js的,即相对于 server.js 的位置。
|
||||
cb(null, folder)
|
||||
cb(null, wo?.envi?.uploadroot) // 目录是相对于本应用的入口js的,即相对于 server.js 的位置。
|
||||
},
|
||||
filename (req, file, cb) {
|
||||
// 注意,req.body 也许还没有信息,因为这取决于客户端发送body和file的顺序。必要的信息请从 req.headers 传递,例如 _passtoken(在multer时,尚未进入路由,不存在已装好的 _passtokenSource)
|
||||
|
Loading…
Reference in New Issue
Block a user