<script type="text/javascript">
if (window.XMLHttpRequest)
xmlhttp=new XMLHttpRequest();
else if (window.ActiveXObject)
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.onreadystatechange=state_Change;
xmlhttp.open("GET",url,true);
alert("Your browser does not support XMLHTTP.");
if (xmlhttp.readyState==4)
document.getElementById('p1').innerHTML=xmlhttp.getAllResponseHeaders();
alert("Problem retrieving data:" + xmlhttp.statusText);
The getAllResponseHeaders() function returns the headers of a resource.
The headers contain file information like length,