我想更改用户头像,但是当我以表单userID和image发送时,UserID在生产时未定义(我使用的是Heroku),如果我只发送没有图像的UserID,则服务器返回ID。关于发展(localmachine)一切都很好。帆0.11
avatar: function (req, res) {
var userID = req.param('id');
req.file('logo').upload(function (err, image) {
if (err) return res.negotiate(err);
if (image.length === 0) return res.badRequest('No file was uploaded');
StorageService.createCloudinray().upload({
image: image[0].fd,
id: userID + '_avatar',
width: 200,
height: 200,
crop: 'limit',
}).done(function (img) {
User
.update(userID, {avatar: img.secure_url})
.exec(function (err, userID) {});
return res.ok(img);
});
});
}
答案 0 :(得分:0)
你可能遇到了这个开放的Skipper问题:
Skipper 0.11在SSL连接上存在未定义ID的错误。