Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

474
Visualizações
Convert axios response to Blob url image to display/download it in website

I'm using the Egnyte API

I don't understand how the response object works, I tried to convert the data to Blob object and URL.createObjectURL but this doesn't work for me. I don't know if I can display this images to my website.

DOCS Egnyte API: LIST FILE OR FOLDER

This problem also happens to me when I want to download the image, because the api response returns plain encrypted text and I don't know how I can convert it into an object to download it with javascript/html

DOCS Egnyte API: DOWNLOAD FILE

Axios get images from Egnyte API

const getImages = () => {
    axios.get(`${API}/${params.id}/images/`, config).then(res => {
        setImagesList(res.data.files)
    }).catch((error) => {
        console.log(error)
    })
}

The response looks like this:

enter image description here

Convert item to Blob object and URL.createObjectURL

const displayImg = (list_images) => {
    return list_images.map(img => {
        const url = URL.createObjectURL(new Blob([img]))
        return (
            <div className='div_img' key={img.name}>
                <img src={url} />
            </div>
        )
    })
}

The URL object looks like this:

enter image description here

But the website looks:

enter image description here

Response from API DOWNLOAD FILE:

enter image description here

I would be very grateful if someone could explain to me how I can convert the API response into an image object to be able to show it and download it (and files to download).

Thank you very much!

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda