title: How can I Upload file to S3 using Next JS with Zeit Now and formidable-serverless
body: <p>Sorry I'm not good at english.
  It works in localhost but not works in production. (deploy with ZEIT NOW)</p>
  <p>This is upload.ts</p>
  <pre><code>import { NextApiRequest, NextApiResponse } from 'next'
  import AWS from 'aws-sdk';
  const formidable = require(&quot;formidable-serverless&quot;);
  AWS.config.region = 'ap-northeast-2';
  
  export const config = {
    api: {
      bodyParser: false,
    }
  }
  
  export default async (req:NextApiRequest, res:NextApiResponse) =&gt; {
    const data = await new Promise(function(resolve, reject) {
      const form = formidable();
  
      form.keepExtensions = true;
      form.keepFilename = true;
  
      form.parse(req, (err:any, fields:any, files:any) =&gt; {
  
        const s3 = new AWS.S3({
          accessKeyId: process.env.AWS_ACCESS_KEY_CODE,
          secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY_CODE
        });
  
        const params = {
          Bucket: 'mybucket',
          Key: `folder/${files.file.name}`,
          ACL: 'public-read',
          Body: require('fs').createReadStream(files.file.path);
        };
  
        s3.upload(params, (err:any, data:any) =&gt; {
          resolve({ err, data });
        });
  
        if (err) return reject(err);
        resolve({ fields, files });
      });
  
    });
  }
  </code></pre>
  <p>I think I can't use 'fs' in serverless. but I can't find another way to upload. help me thank you!</p>