2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ApacheもしくはTomcatでBodyのサイズ制限

Posted at

Bodyのサイズ制限をしようとして、
ApacheのLimitRequestBody、TomcatのmaxPostSizeでハマったのでメモしておく。
結局アプリ内で処理することにした。

日本語のマニュアル https://httpd.apache.org/docs/2.2/ja/mod/core.html#limitrequestbody
の日本語版に特に記述がないので、そのまま使ってみたら、うまく動作しない

ある場所へのファイルアップロードを許可する場合に、 アップロードできるファイルのサイズを 100K に制限したければ、 以下のように指定します:

LimitRequestBody 102400

と思ったら
英語版のマニュアル https://httpd.apache.org/docs/2.2/en/mod/core.html#limitrequestbody
にはPROXYしている場合は、使えない旨が書いてある。。。

Note: not applicable to proxy requests.

If, for example, you are permitting file upload to a particular location and wish to limit the size of the uploaded file to 100K, you might use the following directive:

LimitRequestBody 102400
Note: not applicable to proxy requests.

だからTomcatでmaxPostSizeを使おうと思ったけど
こっちはマルチパート以外は引っかからないらしい。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?