I want to show div with an image, it's name, it's size and it's download link with jquery.
for that, I have made below code
var image = 'image/example.png'
$('#download').attr("href", result2);
$('.image').attr("src", result2);
var name = result2.replace('image/', '');
$('.name').text(name);
$('.filename').css('display','block');
<div class="filename" style="display: none;">
<img src="" class="image" width="100PX" height="100PX">
<b class="name">example.png</b>
<span class="size"></span>
<a href="" download="" id="download" class="btn" style="">DOWNLOAD</a>
</div>
and my image is
everything is working fine except image size I don't know how can I get image size because when I was searching to get image size with it's MB, KB or in bytes with jquery it shows me a result in this formate $("#selector")[0].files[0].size
but in my case, there is no files[0] is available so how can I find image size?