if you are uploading, then you are using server sided code, becaue i dont think you can use ajax to upload a file.
so in what ever server language you're using, get the file via $_POST or whatever and check the file size there... you can also set a maximum file size on forms too.
You down with OOP? Yeah you know me!
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: How to get the file size before Uploading the file?