-1

How to get uploaded file size using JavaScript or jQuery and using codes should be applicable whole browsers (IE,chrome, Firefox...etc)

<input id="id_file" type="file" class="attachefile" name="file" >


$("#id_file").live('change', function(){
  var size = $(this)[0].files[0].size;
  alert(size)
});

This code not working IE browser

Raptor
  • 51,208
  • 43
  • 217
  • 353
sebastian
  • 1
  • 3

1 Answers1

1

A little research reveals that it is possible to restrict the file upload size using HTML5 File API.

Supported IE browser is IE10+

Check this Reading files in JavaScript using the File APIs

EricLaw
  • 55,769
  • 7
  • 146
  • 189
Praveen
  • 53,079
  • 32
  • 129
  • 156