Niraj Nandane
Niraj Nandane

Reputation: 1468

max length for POSTDATA to cgi.pm in perl

I am using CGI.pm in perl for capturing the POSTDATA. What is the maximum limit for it in mega byte. Is it equal to CGI::POST_MAX How to change it ?

Upvotes: 1

Views: 746

Answers (1)

Sobrique
Sobrique

Reputation: 53488

From the CGI documentation:

$CGI::POST_MAX

If set to a non-negative integer, this variable puts a ceiling on the size of POSTings, in bytes. If CGI.pm detects a POST that is greater than the ceiling, it will immediately exit with an error message. This value will affect both ordinary POSTs and multipart POSTs, meaning that it limits the maximum size of file uploads as well. You should set this to a reasonably high value, such as 1 megabyte.

Example given - in same documentation - is:

$CGI::POST_MAX=1024 * 100;  # max 100K posts

Upvotes: 2

Related Questions