faqts : Computers : Programming : Languages : JavaScript : Document

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

19 of 21 people (90%) answered Yes
Recently 7 of 7 people (100%) answered Yes

Entry

Can I read the file size of the current document?

Aug 25th, 2000 07:40
Martin Honnen,


IE provides
  window.document.fileSize
for that. NN has no comparable property in its document object model 
but you can call into java to read the content length header of the url:
  var url = new java.net.URL(location.href);
  var con = url.openConnection(); 
  var l = con.getContentLength();
  alert(l);
Note that the IE value and the NN value read this way might slighly 
differ.