Get image from server and preview it on client
So i'm trying to get an image from a server and previewing it on the client, i can retrieve the image for now, but i don't know how to preview it on a web page asynchronously. axios.get(link,{responseType:'stream'}).then(img=>{ // What i have to do here ? }); Thank you. First, you need to fetch your image with the response type arraybuffer . Then you can convert the result to a base64 string and assign it as src of an image tag. Here is a small example with React. import React, { Component } from 'react'; import axios from 'axios'; class Image extends Component { state = { source: null };