I am trying to add pdf file size after download link as in here http://jsfiddle.net/bf4ovzg0/
I have gone through few other stackoverflow solutions. HOwever, I have been unable to get this working.
var byteSize = $("#url")[0].size;
$( "#url" ).after( byteSize);
//alert (byteSize);
<a href="/media/cache/pdf_to_jpg/article-from-the-journal-of-the-american-medical-women-s-association-on-dr-lucy-gullett-38712.pdf" target="_new" id="url">Download the pdf documents </a>
Any idea how to fix this .. if so, can someone help me out at jsFiddle?
I think I can get a PHP backend version working like below
<?php
$head = array_change_key_case(get_headers("http://ec2-54-253-250-162.ap-southeast-2.compute.amazonaws.com/media/cache/pdf_to_jpg/article-from-the-journal-of-the-american-medical-women-s-association-on-dr-lucy-gullett-38712.pdf", TRUE));
$filesize = $head['content-length']/1000000;
echo $filesize;
echo "MB";
?>
However, I am interested in a jQuery front end version if possible?