-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
  • 53,206
  • 45
  • 230
  • 366
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
  • 56,563
  • 7
  • 151
  • 196
Praveen
  • 55,303
  • 33
  • 133
  • 164