There isn't really a way to do this that is 100% Cross browser compatible since the different browsers use different DOMs as far as file fields are concerned.
here is a thread from stack overflow that gives one way to do it in Fire Fox, but due to browser differences, it wont work for all browsers
how-validate-file-size-using-html-and-javascript-on-client-side