如何检查我的图像是否保存在 Heroku 服务器上

How to check if my images are saved on Heroku server

所以我试图让用户将图片上传到我的服务器,以便稍后在网站上显示。我像这样使用 Multer:

var uploadLogo = multer({
    dest: './public/images/logos/'
});
.post(uploadLogo.single('logo'), (req, res, next) => {
    var r = req.body;
    account.register(
        new account({
                'employer': {
                    'logo': req.file,
                }
            },
            r.password
        ))
});

有趣的是,这在本地版本上有效,但是在网络版本上过一会儿图像就消失了。

如何检查服务器上是否存在图像?或者我应该使用像 imgur 这样的第三方 API 来处理这个问题吗?

免费Heroku dynos are stopped after some time of inactivity, and all the locally stored data is removed. Consider persisting the images in something like AWS S3.