title: Keep original file with multer-s3-transform
body: <p>If I am uploading an image I want multer s3 to keep an original, in addition to create a thumbnail.</p>
  
  <p>In other words. I only want to change the filename in the first transform.</p>
  
  <p>The code below works ish, but the problem is that sharp() modifies the original. Let's say I upload a gif file, the animation will stop working.</p>
  
  <p>I've tried to remove the transform arrow function from the original transform object, but that crashes the code with error <em>dest.on is not a function</em>.</p>
  
  <p>I have tried remove the whole transform object, but since shouldTransform is truthy, it will not upload an original at all.</p>
  
  <p>I have tried to replace <code>sharp()</code> with <code>null</code>, but that gives me this error <em>Cannot read property 'on' of null</em>.</p>
  
  <p>According to docs I should be able to just input a string in the sharp() position, but that also crashes the code.
  Example: <code>cb(null, "something.jpeg");</code>
  Error: <em>dest.on is not a function</em></p>
  
  <p>The documentation on multer-s3-transform is lacking a bit, so I'm just bruteforcing at this point.</p>
  
  <pre class="lang-js prettyprint-override"><code>const awsStorage = multerS3({
      s3,
      bucket: process.env.AWS_BUCKET_NAME,
      shouldTransform: (transformReq, file, cb) =&gt; {
          cb(null, /^image/i.test(file.mimetype));
      },
      key: (transformReq, file, cb) =&gt; {
          const splitFileName = file.originalname.split('.');
          const fileEnding = splitFileName[splitFileName.length - 1];
          cb(null, `files/${dateNow}.${fileEnding}`);
      },
      transforms: [
          {
              id: 'original',
              key: (transformReq, file, cb) =&gt; {
                  const splitFileName = file.originalname.split('.');
                  const fileEnding = splitFileName[splitFileName.length - 1];
                  cb(null, `files/${dateNow}.${fileEnding}`);
              },
              transform: (transformReq, file, cb) =&gt; {
                  cb(null, sharp()); // This is where I'm struggling
              },
          },
          {
              id: 'thumbnail',
              key: (transformReq, file, cb) =&gt; {
                  const splitFileName = file.originalname.split('.');
                  const fileEnding = splitFileName[splitFileName.length - 1];
                  cb(null, `thumbnails/${dateNow}.${fileEnding}`);
              },
              transform: (transformReq, file, cb) =&gt; {
                  cb(
                      null,
                      sharp()
                          .resize(200, 200)
                          .png()
                  );
              },
          },
      ],
  });
  </code></pre>