in reply to Restricting file upload size

Please read CGI

"Is this is bytes or kb?"

From CGI: "If set to a non-negative integer, this variable puts a ceiling on the size of POSTings, in bytes."

"What do YOU think a fair size would be to restrict to?"

This is impossible to answer in a sane fashion, for you don't specify what is being uploaded. Are they JPEGs of pictures for a contest? Background images? In other words, please explain what you really want to be uploaded.

"What happens if the file they attempt to upload is greater than that of which I limited? Will the script die? I'd like to control this error if I could using something like if (size is to big) { print the size is to big; exit}, for a cleaner death error."

Again 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"."

"$CGI::POST_MAX. Can this be $CGI::$max_num and still work?"

What is $CGI::$max_num ?

"Is there an easy yet safe way to restrict file sizes on a specific variable/filehandle?"

Create several upload forms? I'm not sure how to handle this best, but I'm sure some other monks will help you out on this one.

--
b10m

All code is usually tested, but rarely trusted.