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

194
Visualizações
facebook image url to blob data

I'm trying to grab blob data from the url image provided by facebook. I'm new to network protocols and most of the questions seem to be out of date or in php. This is being done on a node server and the url is being passed in, it come in good and still works but the image won't load in. I've tried using XMLHttp to get the image in blob form but it gives back "network error".

const XMLHttpRequest = require('xhr2');
  function loadXHR(url) {
    return new Promise((resolve, reject) => {
      try {
        var xhr = new XMLHttpRequest();
        xhr.open("GET", url);
        xhr.responseType = "blob";
        xhr.onerror = function() {reject("Network error.")};
        xhr.onload = function() {
            if (xhr.status === 200) {resolve(xhr.response)}
            else {reject("Loading error:" + xhr.statusText)}
        };
        xhr.send();
      }
      catch(err) {reject(err.message)}
    });
  }

Not sure what the way to get the blob data is. I'm going to store the blob in the db after load to then serve it back to user later so just storing the urls doesn't work as they expire. I feel like I'm missing something simple but don't know where to find it.

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