T
T
Timur Evgazhukov2017-03-23 10:24:22
Java
Timur Evgazhukov, 2017-03-23 10:24:22

Why are requests with a large data size not passed to the handler in the Spring MVC controller?

On the client side, I form a POST request, and in the data in one of the fields the image is stored in base64 format. On the client side, I successfully receive all the data and the picture itself, while it is not very large. But as soon as the size of the picture starts to exceed some threshold, then the data stops coming and all RequestParam is either null, or the client simply returns the error code 400 (Bad request). For example, in pictures at 835 KB, everything is fine, but if it’s already 1.7 MB, it stops working (I didn’t determine more precise boundaries, but I think it’s around 1 MB). What could be the reason and how to either increase the limit, or rebuild the request and transmit, for example, in portions or in some other way?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Eugene Khrustalev, 2017-03-23
@evgajukov

tomcat? It has the default parameter maxPostSize = 2 Mb
https://tomcat.apache.org/tomcat-8.0-doc/config/ht...

T
Timur Evgazhukov, 2017-03-24
@evgajukov

It's strange, the maxPostSize parameter on the local server solved the problem, but on the combat one it didn't change.
Now on the production server (Tomcat 7.0.47):
The server is available via ssl, I doubt it, but maybe it somehow affects.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question