title: Piping a multipart/form-data request to another request while changing some fields names in Node.js
body: <p>I want to stream a file upload request in multipart/form-data to another server and change some fields name at the same time.</p>
  
  <p>I don't want to store temporarily a file on disk and don't want to store the file completely in memory either.</p>
  
  <p>I tried to use multer, busboy and multiparty. I think I got closer by using custom Transform streams but it is not working yet.</p>
  
  <pre class="lang-js prettyprint-override"><code>const express = require('express');
  const request = require('request');
  const { Transform } = require('stream');
  
  const router = express.Router();
  
  class TransformStream extends Transform {
    _transform(chunk, encoding, callback) {
      // here I tried to manipulate the chunk
      this.push(chunk);
      callback();
    }
  
    _flush(callback) {
      callback();
    }
  }
  
  router.post('/', function pipeFile(req, res) {
    const transformStream = new TransformStream();
    req.pipe(transformStream).pipe(request.post('http://somewhere.com'));
    res.sendStatus(204);
  });
  </code></pre>
  
  <p>I tried to manipulate chunks in <code>_transform</code> without success (EPIPE). It sounds quit hacky, are they any better solutions ?</p>