title: How to retrieve a file/image in Sequelize
body: <p>I am using sequelize and i have successfully uploaded a file to a folder and saved it's name in the database.Now i want to retrieve the image in postman.I am getting the name of the image when i use the get request.How to do I get the actual Image which has been stored in the uploads folder.</p>
  <p>Below is my code.</p>
  <p>middleware/upload.js</p>
  <pre><code> const multer = require(&quot;multer&quot;);
  
  const imageFilter = (req, file, cb) =&gt; {
    if (file.mimetype.startsWith(&quot;image&quot;)) {
    cb(null, true);
     } else {
      cb(&quot;Please upload only images.&quot;, false);
    }
     };
  
    var storage = multer.diskStorage({
    destination: (req, file, cb) =&gt; {
    cb(null, &quot;./uploads/&quot;);
   },
     filename: (req, file, cb) =&gt; {
     let name =  `${Date.now()}-Shehryar-${file.originalname}`
     req.body.fingerPrints = name
     cb(null,name);
    },
    });
  
     var uploadFile = multer({ storage: storage, fileFilter: imageFilter });
     module.exports = uploadFile;
  </code></pre>
  <p>route/user.js</p>
  <pre><code>const { Router } = require('express');
  const user = require('../controllers/user.controller.js');
  const upload = require(&quot;../middleware/upload&quot;);
  const user_router = Router();
  
  user_router.post('/createUsers',upload.single(&quot;fingerPrints&quot;),user.create);
  user_router.get('/getall', user.findAll);
  user_router.get('/get/:code', user.findById);
  user_router.put('/update/:code', user.update);
  user_router.delete('/delete/:code', user.delete);
  
  module.exports = user_router;
  </code></pre>
  <p>controller/user.js</p>
  <pre><code> exports.create = (req, res) =&gt; {
      let codeGenerate = Math.random().toString(36).substring(2,7);
  
  End_user.create({
      code:codeGenerate,
      firstName: req.body.firstName,
      middleName: req.body.middleName,
      lastName: req.body.lastName,
      nickName: req.body.nickName,
      email: req.body.email,
      mobileNumber: req.body.mobileNumber,
      bloodGroup:req.body.bloodGroup,
      fatherName: req.body.fatherName,
      motherName: req.body.motherName,
      bForm: req.body.bForm,
      fingerPrint: req.body.fingerPrints
  }).then(user =&gt; {
      res.send({message :`User Created With Code ${user.code}`});
  }).catch(err =&gt; {
    res.send(err.message);
   });
  };
  </code></pre>