+1  A: 

You can use Ajax, once you have file path in file input field, you send an ajax request to some server-side language to calculate its size and act accordingly. The other way is to use FSO (File System Object) but this will work only in IE.

Sarfraz
A: 

In modern browsers there have been a lot of measures put in place to keep a (malicious) developer from determining anything about the user's filesystem. As a result there is little you can do in this respect in JavaScript.

There are several alternatives I can think of.

  1. Use the filesystem object (ActiveX) in IE (only) as mentioned by sAc.
  2. Write a flash applet that handles the uploading of files (like gmail does).
  3. Write any other type of plugin (Java, etc) or applet that would do the same as #2.

You're not going to get the information you're looking for using pure JavaScript without a roundtrip to the server.

angryundead