title: set multer destination in api.js in nodejs and call another function?
body: <p>i am using a <strong>api</strong> in server.js file.</p>
  
  <pre><code>app.post('/api/uploadalumniresume', api.UploadAlumniResume);
  </code></pre>
  
  <p>my api.js file code is:</p>
  
  <pre><code>exports.UploadAlumniResume = (req, res) =&gt; {
    const storage = multer.diskStorage({
      destination(req, file, cb) {
        // cb(null, `${__dirname}public/images/uploads`);
        cb(null, `${__dirname}/../public/imports`);
      },
      filename(req, file, cb) {
        cb(null, `${Date.now()}-${file.originalname}`);
      },
    });
  
  
    const importupload = multer({
      storage,
    });
    const importmulter = importupload.single('file');
  };
  </code></pre>
  
  <p>The server.js as call the <strong>api</strong> but the exports api not saving the uploading file to the destination folder</p>
  
  <p>And i need to store the upload file on destination follder.</p>
  
  <p>And if the file as uploaded then function need to work on create fuction in the same api.</p>
  
  <p>please give a any solution to me!</p>