Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: Preventing Oversized Uploads

by Kirsle (Pilgrim)
on Dec 05, 2009 at 03:09 UTC ( #811187=note: print w/replies, xml ) Need Help??


in reply to Re: Preventing Oversized Uploads
in thread Preventing Oversized Uploads

That was my thought too at one point. But then I set that 15 second alarm clock for the whole script. In Google Chrome you can see the % uploaded while it sends the file to the server; immediately after it got to 100% I got my error message about the timeout expiring. So it looked like Apache started my CGI script earlier and it waited for a while (perhaps when the CGI object is created it blocks until Apache receives the whole request?)

Setting an upload hook is how you can create a progress bar for file uploads; in this case the CGI script is running since the beginning of the request. Although in my experience if the upload hook crashes (intentionally or due to run-time error) it doesn't affect the rest of the script.

Anyway, I looked into that Apache config instead. I put a limit of 5 MB for the directory that contains this (and other) CGI scripts - none of the other CGI scripts accept inputs greater than 5 MB (in fact none of them accept higher than 1 MB but I'm adding some wiggle room). Tried uploading VirtualBox again instead of a font file, and after 5 MB was uploaded Apache reset my connection. :)

Cheers.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://811187]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2021-09-24 23:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?