PHP will not be able to check the file size before the file upload is executed. There is no way you can detect on the desktop's directory. File upload has to occur first, and then the script checks on the file size..
There is another way of doing this.. it is called flash dependency class.. try searching filereference class, externalReference class... that should work for what you are trying to achieved.
If you use the flash dependency, you must use this responsibly and only for the purpose of serving the file size detection function and upload function. This can throw many security holes on the desktop side.