Posted By

ezerick on 01/19/11


Tagged


Versions (?)

Who likes this?

6 people have marked this snippet as a favorite

qubestream
AllKnightAccess
johnw
matylla
virendrakryadav
wirenaught


Get size of file requested via ajax


 / Published in: jQuery
 

  1. var xhr = $.ajax({
  2. type: "HEAD",
  3. url: "path/to/file.ext",
  4. success: function(msg){
  5. alert(xhr.getResponseHeader('Content-Length') + ' bytes');
  6. }
  7. });

Report this snippet  

You need to login to post a comment.