About Linux FAQ

Browse More FAQs:

LimitRequestBody: Apache Limiting User Upload File Size

Posted by Vivek on Saturday April 26, 08 (3 weeks ago) @10:52 am

Q. I'd like to put limits on user file uploading size. How do I restricts the total size of the HTTP request body sent from the client under Apache 2 Web server?

A. To restricts the total size of the HTTP request body sent from the client use LimitRequestBody Directive. You can add this directive using .htaccess file or httpd.conf file under virtual host or directory configuration options. You can set value (in bytes) from 0 (unlimited) to 2147483647 (2GB) that are allowed in a request body.

For example, limit /var/www/vhost/cyberciti.biz/wp-uploads to 100K, you might use the following directive (add to .htaccess or httpd.conf file):

<Directory "/var/www/vhost/cyberciti.biz/wp-uploads">
    LimitRequestBody 102400
</Directory>

Restart httpd (if added to httpd.conf):
# service httpd restart

References:

Subscribe to our free e-mail newsletter or RSS feed to get all updates. You can Email this page to a friend.

Related Linux / UNIX FAQ:

Discussion on This FAQ

  1. Firas Alfraih Says:

    how can I restrict abuse the internet (heavy download) on my linux firewall

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Please do not use the comment form to ask for help / question. Ask your question on the excellent Linux tech support forum. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Tags: , , , , , , , , , ~ Last updated on: April 26, 2008

Copyright © 2006-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.