My springboot version is 2.0.2 ,My controller could receive the request param .While The controller wants to receive a 16-megabyte string.How to specify the spring boot config params?
Asked
Active
Viewed 44 times
0
-
There is a limitation on max length of request parameter (as query param) or as request body. I don't think it is a good idea to send 16MBs of data as request param. Rather use multi-part request. – Manmay Jul 12 '18 at 08:47
-
1I am curious what might be the use-case for a 16 MB requestParam? – Hasan Can Saral Jul 12 '18 at 08:51
-
@Manmay, how to specify the limitation ,could you provide some param config ? It may be 1MB. – Jim Green Jul 12 '18 at 09:10
-
spring.servlet.multipart.max-file-size=10MB spring.servlet.multipart.max-request-size=10MB – Manmay Jul 12 '18 at 09:56
-
Refer : https://stackoverflow.com/questions/34177873/max-limit-of-multipartfile-in-spring-boot – Manmay Jul 12 '18 at 09:56
-
@Manmay It could not help me , some controller url may upload a larger file(which is 10MB), while my expected controller url may not exceed 1M, so I can set spring.servlet.multipart.max-request-size=10MB, but I do not want my expected url param exceed 1MB. How to set? – Jim Green Jul 12 '18 at 11:01
-
Then you can set the size to 1MB instead of 10 MB in the config – Manmay Jul 16 '18 at 12:32