The task is to get the picture from the link available, encode it in base64 and send it to your server. I stumbled upon receiving a picture from the server, I see in the debugger that the picture was received, more precisely the bytes, but the answer to the request still falls into fail() :
$.ajax({ type: 'GET', url: "https://www.w3schools.com/css/img_viewport2.png", dataType: 'image/jpg', success: function(data) { alert("ok"); } }).fail(function(XHR) { alert("false"); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
dataType: 'image/png',- DNS