Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

258
Views
Error: ENOENT: no such file or directory, open 'G:\legalapp-backend\uploads\panCard-1647792449153'

i'm trying to upload files through postmon using multer ( nodejs ) but it show error. i don't know what happened in this code. i first time used multer module. i need to upload multiple fields data like,

<input type="file1" >
<input type="file2">

so, what i do?

GSTPropritor.js

const multer = require('multer')

const storage = multer.diskStorage({
    destination: function (req, file, cb) {
        cb(null, "./uploads");
    },
    filename: function (req, file, cb) {
        cb(null, file.fieldname + '-' + Date.now());
    },
});

const upload = multer({ storage: storage });

var uploadMultiple = upload.fields([
    { name: 'panCard' }, 
    { name: 'aadharCard' }
]);

const uploadDoc = async (req, res, next) => {
    console.log(req.file)
}

module.exports = { uploadMultiple, uploadDoc };

console Error

Error: ENOENT: no such file or directory, open 'G:\legalapp-backend\uploads\panCard-1647792449153'rd-1647792449153'

routes.js i pass the function and middleware like this...

router.post('/upload', uploadMultiple, uploadDoc);
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!