How to get the cententLength of image obtained with image tag?

how do I get the cententLength of image"s response header obtained with the image tag?

Mar.23,2021

the src that gets the image tag initiates a get request for ajax and then takes



let img= new Image;
img.src= "xxx.png";
then uses igm.onload to get


  var img = new Image();
  img.src = "";
  img.onload = function(){
     alert(img.width);
     alert(img.height);
  }

you can't get it with image tag

Menu