我使用csrf做校验,但是当我在表单中设置了form的 enctype="multipart/form-data"后,校验一直提示session失效如何解决? 我试着在post时显示用buyboy校验,但是还是一样提示session失效。求解决办法: app.js
app.use csrf()
exports.upload = (req,res)->
#Explicitly handle uploads
busboy = new Busboy({ headers: req.headers })
busboy.on 'file', (fieldname, file, filename, encoding, mimetype)->
saveTo = path.join(process.cwd() + '/public/images/', path.basename(fieldname) + path.extname(filename))
file.pipe(fs.createWriteStream(saveTo))
busboy.on 'finish', ()->
req.flash('success', '文件上传成功!');
res.redirect('/')
return req.pipe(busboy);