The reason I want to know the size is to abort the web submission process when the input/upload is too large
Right ... the client does not send that data back to you on a per-field basis. You can abort if all the data is too large but per field, you need to actually read the param before you can determine if it's too big for your needs.
To limit for all POST data, follow the example from CGI:
An attempt to send a POST larger than $POST_MAX bytes will cause param() to return an empty CGI parameter list. You can test for this event by checking cgi_error(), either after you create the CGI object or, if you are using the function-oriented interface, call <param()> for the first time. If the POST was intercepted, then cgi_error() will return the message "413 POST too large".use CGI qw/:standard/; use CGI::Carp ’fatalsToBrowser’; $CGI::POST_MAX=1024 * 100; # max 100K posts
In reply to Re^3: To know parameter size in CGI.pm
by derby
in thread To know parameter size in CGI.pm
by monkfan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |