# Is there any way to limit upload size RELIABLY using Apache and Mongrel BEFORE upload completes?

**URL:** <https://www.ruby-forum.com/t/is-there-any-way-to-limit-upload-size-reliably-using-apache-and-mongrel-before-upload-completes/144546>\
**Category:** Rails\
**Created:** [July 30, 2008, 9:05pm UTC](https://www.ruby-forum.com/t/is-there-any-way-to-limit-upload-size-reliably-using-apache-and-mongrel-before-upload-completes/144546 "2008-07-30T21:05:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DavidB](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/76d3ee/32.png) [@DavidB](https://www.ruby-forum.com/u/DavidB)\
**Post date:** [July 30, 2008, 9:05pm UTC](https://www.ruby-forum.com/t/is-there-any-way-to-limit-upload-size-reliably-using-apache-and-mongrel-before-upload-completes/144546/1 "2008-07-30T21:05:36Z")

</div>

I posted an issue yesterday, and perhaps I did not post it clearly  
enough. I am curious to see if it is possible to limit a file upload  
reliably so that someone does not try to upload a 100mb or 1gb photo  
for example. Attachment\_fu and file\_column and even paperclip can be  
used to do this on the server side, I think AFTER the upload has  
occurred.

SWF upload can do this on the client side, but we don’t have a whole  
lot of control on the client side, and I do not know how much I would  
like to depend on flash.

I would typically use LimitRequestBody on the APache config file, but  
since I use several mongrels via a proxy load balancer, the  
LimitRequestBody is useless since the request bypasses typical Apache  
protective mechanisms and is sent to mongrel.

Is there any way to limit upload size RELIABLY using Apache and  
Mongrel BEFORE upload completes?

David
