我已经使用每个用户在我的应用程序中注册的multer上传了图片,一切正常。但是,当特定用户登录后,如何在前端页面中显示该特定图像?我已经将图像保存在./public/images
这只是我的代码register.js的一小部分 //发布请求
router.post('/register', multer(multerConfig).single('profileimage') ,function(req, res, next) {
var name = req.body.name;
var email = req.body.email;
var username = req.body.username;
var password = req.body.password;
var password2 = req.body.password2;
if(req.file){
console.log('Uploading File...');
var profileimage = req.file.filename;
}
else {
console.log('No File Uploaded...');
var profileimage = 'noimage.jpg';
}
先谢谢您