JSFiddle - React, Tailwind, and code Playground

by Tushar Thakare

HTML

<form method="post" enctype="multipart/form-data" onsubmit="return check();">
<input type="file" name="imgfile" id="imgfile"><br><input type="submit">
</form>

JavaScript

var imageUrl = 'https://upload.wikimedia.org/wikipedia/commons/thumb/c/cd/Henri_Gervex_-_A_Session_of_the_Painting_Jury_-_Google_Art_Project.jpg/399px-Henri_Gervex_-_A_Session_of_the_Painting_Jury_-_Google_Art_Project.jpg';
var blob = null;
var xhr = new XMLHttpRequest(); 
xhr.open('GET', imageUrl, true); 
xhr.responseType = 'blob';
xhr.onload = function() 
{
    blob = xhr.response;
    alert(blob, blob.size);
}
xhr.send();