There are similar questions like [this](https://stackoverflow.com/questions/58974487/how-to-download-an-image-as-stream-then-upload-it), [this](https://stackoverflow.com/questions/33181758/how-to-upload-a-remote-image-in-node-request), [this](https://stackoverflow.com/questions/47630163/axios-post-request-to-send-form-data), and [this](https://stackoverflow.com/questions/44302043/node-js-how-to-post-image-along-with-request-data-to-another-server-api), but none help.

In Node, the goal is to use the axios module to download an image from Twitter then upload this image as an image file as part of a form submission.

This code downloads the Twitter image, but the uploaded binary image is corrupted when it reaches the server (also our server).

The image must be uploaded in binary.

A form is required because other fields are also submitted with the binary image. These other form fields were removed to simplify the code sample.

```
        const axios = require('axios');
        const FormData = require('form-data');

        let response = await axios.get('https://pbs.twimg.com/media/EyGoZkzVoAEpgp9.png', {
                                responseType: 'arraybuffer'
                             });

        let imageBuffer = Buffer.from(response.data, 'binary');    
        let formData = new FormData();          
        formData.append('image', imageBuffer);

        try {
            let response = await axios({
                method: 'post',
                url: serverUrl,
                data: formData,
            });

            // Do stuff with response.data

        } catch (error) {
            console.log(error)
        }

```