CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Advanced:
Uploading Limit Problem!



Apr 22, 2002, 10:29 AM

Post #1 of 3 (3334 views)
Uploading Limit Problem! Can't Post

I have an upload program which allows users to upload files to a web server, I have used the following code in the program:

$CGI::POST_MAX = 1024 * 20;

which limits the users to uploading a file below 20kb.

When a user uploads a file which is above 20kb, the upload fails and returns to a blank web page.

Does anyone know how to display an error message when they try to upload a file which is too big.


Ben Chivers
Wheres the damn coffee? zzzZZZZZ!!!

User / Moderator

Apr 22, 2002, 12:21 PM

Post #2 of 3 (3332 views)
Re: [benchivers] Uploading Limit Problem! [In reply to] Can't Post


From POD:


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''.


print unpack"u*",pack "h*",$a,"\n\n";


Apr 25, 2002, 5:33 AM

Post #3 of 3 (3325 views)
Re: [benchivers] Uploading Limit Problem! [In reply to] Can't Post

Oh, and normally blank pages could appear when the script fails.

something like "use CGI::Carp qw(fatalsToBrowser);" can be a great debugging tool.

Yet Another Perl Programmer

~~> [url=] <~~
More then 3500 X-Forum [url=]Downloads! Cool


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives