I am using CGI.pm to handle a file upload section of a script but I'm encountering a problem when it comes to limiting the size of the file uploads. I am presently using $CGI::POSTMAX to set the max upload size to 100KB but it seems when someone tries to upload a file larger, say 1MB, they are simply taken back to the main page - no error or anything which is confusing.
I have been searching for a way to print an error if the file is too large but the only solutions I have found are to upload the file, then check the size and delete it if it is too big which doesn't really prevent abuse from people uploading 10MB files.