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.
It's a hard problem. You have to do it with AJAX, and use the filesize headers sent by the browser to the server on the POST request.
Yahoo's UI Library has a tool to help with this. YUI Uploader
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With