I am working on a web application which supports file uploading. I am already familiar checking the size in server side, but i wanted to check the file size in a client side.
It is possible to determine the size of the file that is on uploading even before the uploaded file has been transfered completely. Even when using Internet Explorer. By using the HTTP's content-length header!
In java world:
First of all the if you handle the request that arrive to the server in the first servlet/filter/controller before any previous thread mass with it, you'll be albe to get the total file size in the content-length header (request.getContentLength()).
second- have a look in an ajax implementation that prove that it is possible:
http://www.ajaxfilebrowser.com/