in reply to Re^2: File Upload Size Check
in thread File Upload Size Check

it is throwing some error

What error exactly? I know what I mean. Why don't you?

Replies are listed 'Best First'.
Re^4: File Upload Size Check
by coolsaurabh (Acolyte) on Aug 06, 2019 at 03:59 UTC
    Suppose if I set the file size 1 MB in script and when I am trying to upload the file greater than 1 MB,it is throwing error "Failed to execute CGI "/cgi-bin/Maintenance_Framework.cgi". Contact your administrator." In my view,it should display that "File is too big for upload".

      From the documentation I linked to:

      If CGI.pm detects a POST that is greater than the ceiling, it will immediately exit with an error message.

      The code you posted displays an upload too large error on the condition:

      if ( !$filename ) { ....
      "Failed to execute CGI "/cgi-bin/Maintenance_Framework.cgi". Contact your administrator."

      That sounds like a message from the web server, not from Perl, so you should check your server's error logs for the message that Perl is giving you. See also CGI Help Guide and Troubleshooting Perl CGI scripts.