title: await only valid in async function meanwhile i already put "async" in the function
body: <p>It says that await only valid for async function but i already put the async word before the (req,res,next) , did i code it wrong?</p>
  <pre><code>const axios = require(&quot;axios&quot;);
  const FormData = require(&quot;form-data&quot;);
  const imageKit = async (req, res, next) =&gt; {
  if (req.files) {
    try {
      const files = req.files;
      const values = Object.values(files);
      values.map((perArray) =&gt; {
        perArray.forEach((item) =&gt; {
          if (item.mimetype === &quot;image/jpeg&quot; || item.mimetype === &quot;image/png&quot;) {
            const newForm = FormData();
            const encodedFile = item.buffer.toString(&quot;base64&quot;);
            newForm.append(&quot;file&quot;, encodedFile);
            newForm.append(&quot;fileName&quot;, item.originalname);
            const encodedKey = Buffer.from(
              process.env.IMAGE_KIT + &quot;:&quot;
            ).toString(&quot;base64&quot;);
            const result = await axios({
              method: &quot;POST&quot;,
              url: &quot;https://upload.imagekit.io/api/v1/files/upload&quot;,
              data: newForm,
              headers: {
                ...newForm.getHeaders(),
                Authorization: `Basic ${encodedKey}`,
              },
            });
          }
        });
      });
    } catch (error) {}
  }
  };
  </code></pre>