How to retrieve the size of a file before uploading it?

Posted by geowa4 on Stack Overflow See other posts from Stack Overflow or by geowa4
Published on 2009-02-13T19:17:55Z Indexed on 2010/03/19 3:51 UTC
Read the original article Hit count: 262

Filed under:
|
|
|

I have an file input tag in my web app. I'd like to check that the file isn't too big before sending it to the server. Of course, I still have validation server side. Is there any way to do this with JavaScript? It must work in IE7+ and FF3+. Thank you.

EDIT: somefileinputobject.files[0].filesize works in FF, but not IE.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about input