Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

195
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda