title: React Native and XMLHttpRequest - Upload Progress bar
body: <p>I'm using XMLHttpRequest to upload <strong>images</strong> to my server in a post request and the images are <strong>in base64 format</strong>. I looked all over the web and found that i can add a &quot;progress&quot; event to the upload. but it only fires when upload is complete... how can I get upload progress for such request in react-native?</p>
  <pre><code>const http = new XMLHttpRequest();
  
  http.upload.addEventListener(&quot;progress&quot;, function(e){}); // first attempt, not working...
  http.addEventListener(&quot;progress&quot;, function(e){}); //second attempt, not working...
  
  
  http.open(&quot;POST&quot;, url, true);
  
  //Send the proper header information along with the request
  http.setRequestHeader(&quot;Accept&quot;, &quot;application/json, application/xml, text/plain, text/html, *.*&quot;);
  http.setRequestHeader(&quot;Content-type&quot;, &quot;application/x-www-form-urlencoded; charset=utf-8&quot;);
  
  http.send(params);
  </code></pre>
  <p>The answers mentioned in <a href="https://stackoverflow.com/questions/76976/how-to-get-progress-from-xmlhttprequest">How to get progress from XMLHttpRequest</a>
  don't work. My guess is that react-native requires a different solution.</p>