I have written some code which uploads a file.

Before I upload the file I would like to check on the file size. If its below a certain limit I want to upload it else present the user with an error message.

Any Ideas ?