Click here to Skip to main content
15,883,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
For some reason I am not able to override Tomcat's settings about the file size limit when working with the UAT profile environment (everything works smoothly on SIT)

I am using Spring Boot 2.2 and i am adding these properties to the configuration file:

Java
spring.servlet.multipart.max-file-size=25MB
spring.servlet.multipart.max-request-size=25MB


However when i run my application on the Eclipse IDE (clean install and profile UAT) it gives me errors when I try to upload files which are greater than 1MB (which AFAIK is the default Tomcat's file limit size).

A couple more things to point out:

1) Both the application-sit.properties file and the application-uat.properties have all of the instructions placed in the same order.
2) When I try to upload file whose size is lower than 1MB i get another error which is UnsupportedMediaType and so I was wondering whether the problem was in my Angular front-end or in my Spring Boot back-end application.

Oh... and I run my SIT application locally while the UAT application is run in a VM (it wouldn't surprise me if it is something that has to do with the VM).

Thank you all in advance for the help, I'm open to answer if you need more informations. Have a nice day.

What I have tried:

I tried using tomcat's properties like these:
server.tomcat.max-http-post-size=6291456


I tried rewriting the whole
application-uat.properties
file to make it as close as possible to
application-sit.properties


I tried changing the front-end in order to replace the XMLHTTPRequest with a simple http.post() Observable but I get CORS errors (which I don't get by using XHR, don't ask me why i have no clue).
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900