|
From: Jamie C. <jca...@we...> - 2006-02-09 22:08:16
|
Hi Dave,
In your custom module, you can pass a parameter to the ReadParseMime function to limit uploads to a specified number of bytes. This is the only function that actually reads the upload into memory - the main miniserv.pl process does not.
- Jamie
-----Original Message-----
From: Dave Isaacs <dav...@en...>
Subj: [webmin-l] Restricting file upload size
Date: Fri 10 Feb 2006 2:37 am
Size: 1K
To: "'web...@li...'" <web...@li...>
Restricting file upload size
Is there any way to have miniserv reject file uploads over a certain size?
I have implemented a custom module that allows users to upload an image file. However, if the user attempts to upload a very large file (say 1GB), the whole server grinds to a halt as miniserv attempts to load the file into memory.
I can put size restrictions in my module, but miniserv still attempts to upload the entire file before passing control to my module. What I need to happen is for miniserv to reject the upload immediately (perhaps with Error 413 - Request Entity Too Large), without uploading anything.
Thanks
Dave Isaacs
--- message truncated ---
|