[Fixed]-Zip File downloaded from ReactJs/Axios is corrupted

9👍

The problem was that ‘responseType’: ‘arraybuffer’ should not be in “headers.”

22👍

To add to btbam91’s reply: responseType has to be part of the config. In the above example:

 axios
    .post('http://0.0.0.0:8000/sheets/', data,
        {
            responseType: 'arraybuffer',
            headers: {
                'Content-Type': 'multipart/form-data',
            }
        })

Leave a comment