Multer : Setting different destinations in the destination Property
<p>I have a case where I need to store images in different directories . So I have set the multer as.</p>

<pre><code>    app.use(multer({
  dest: path.join(__dirname, '`public/assets/img/profile`'),
  rename: function (fieldname, filename, req, res) {
    if(req.session.user) return req.session.user.id;
    else if(req.session.doctor) return req.session.doctor.id;
  }
}));
</code></pre>

<p>However I need more destinations to store images. </p>

<pre><code>public/assets/img/picture1
</code></pre>

<p>I have seen similar questions but I could not understand any of them.
Any help would be greatfull.</p>