Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

193
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!