As I understand it, you just want to do a quick file size check before having your script go to all the trouble of processing the input. If so, why does it have to be accurate? Give yourself a wide margin of error - like say 20K for all text fields - then do another, exact check after the file has been processed. This way you stop huge inputs immediately, but still don't cut off users who are making valid requests.