0

I'm using JQuery to check the file size and type on a form file input field. The HTML is:

<input name="source" id="imageFile" type="file" style ="border: 1px solid #576675;">

and the JQuery:

$('#imageFile').bind('change', function() {

   var imageSize = this.files[0].size/1048576;
   var imageType = this.files[0].type.toString();

   //.... checking different condition for imageSize and imageType....///
});   

The code works on both FireFox and Chrome, but in IE9 I get the following error:

SCRIPT5007: Unable to get value of the property '0': object is null or undefined 

I've read this post, but is there really no way to do this in IE9 ?

Thanks...

Community
  • 1
  • 1
Alon Adler
  • 3,984
  • 4
  • 32
  • 44

1 Answers1

0

It might be related to many other issues that you get this error with - of which I've come across also before.
See this SO link - IE9 JavaScript error: SCRIPT5007: Unable to get value of the property 'ui': object is null or undefined

I'm quite sure the meta tag solution worked for me. Otherwise you may have to not do certain tasks in IE9 if this solution cannot work for you.

Community
  • 1
  • 1
dan richardson
  • 3,871
  • 4
  • 31
  • 38