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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

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

 



benchivers
Novice

Apr 22, 2002, 10:29 AM

Post #1 of 3 (2074 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.



Regards,

Ben Chivers
Wheres the damn coffee? zzzZZZZZ!!!


fashimpaur
User / Moderator

Apr 22, 2002, 12:21 PM

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

benchivers,

From CGI.pm POD:

Quote


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

Dennis

$a="c323745335d3221214b364d545".
"a362532582521254c3640504c3729".
"2f493759214b3635554c3040606a0",
print unpack"u*",pack "h*",$a,"\n\n";


yapp
User

Apr 25, 2002, 5:33 AM

Post #3 of 3 (2065 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=http://www.codingdomain.com]www.codingdomain.com <~~
More then 3500 X-Forum [url=http://www.codingdomain.com/cgi-perl/downloads/x-forum]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