in reply to File Upload Size Check

$CGI::POST_MAX = 1024 *1024 ;

For a 5MB limit should be:

$CGI::POST_MAX = 1024 * 1024 * 5;

CGI/$CGI::POST_MAX.

Replies are listed 'Best First'.
Re^2: File Upload Size Check
by coolsaurabh (Acolyte) on Aug 05, 2019 at 12:29 UTC
    Yes it should be what you suggested. However when i am trying to upload the file greater than 5MB size,it is throwing some error.
        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".

      Your code posted has a limit of 1MB. If you want a 5MB limit set it to what I showed you, if you want to upload something bigger, change the multiplier. Also ensure your web server isn't configured to limit file uploads.