title: Download then upload image without storing it
body: <p>I am currently attempting to get an image upload component built in Zapier but am having issues getting it to work. I have to be able to download an image, and then POST it to a new endpoint without storing it locally. Currently, the closest I've been able to do is get an IncomingMessage to POST, but I know that's not right.</p>
  <p>Does anyone have any advice?</p>
  <pre><code>let FormData = require('form-data');
  let http = require('https');
  
  const makeDownloadStream = (url) =&gt; {
    new Promise((resolve, reject) =&gt; {
      http.request(url, resolve).on('error', reject).end();
    });
  }
  
  const makeUploadStream = (z, bundle, options) =&gt; {
      var imageRequest = options;
      const promise = z.request(imageRequest);
      return promise.then((response) =&gt; {
          return response.data;
      });
  }
  
  const addAttachment = async (z, bundle) =&gt; {
      /*var request = {
          'url': bundle.inputData.attachment
      };
      const promiseAt = z.request(request);
      return promiseAt.then((stream) =&gt; {*/
          const form = new FormData();
          var data = `{&quot;type&quot;: &quot;records&quot;, &quot;attributes&quot;: {&quot;form_id&quot;: ${bundle.inputData.form_id}}}`
          const stream = await makeDownloadStream(bundle.inputData.attachment);
          form.append(`field_${bundle.inputData.field_id}`, stream);
          form.append('data', data);
          var request = {
              'url': bundle.inputData.url,
              'method': 'PUT',
              'headers': {
                  'Content-Type': `multipart/form-data; boundary=${form.getBoundary()}`
              },
              'body': form
          };
          const response = await makeUploadStream(z, bundle, request);
          return response;
      //});
  }
  </code></pre>