What is the maximum value which can be set for "spring.servlet.multipart.max-file-size" for multipart uploads in spring boot 2?
Can we set it to unlimited?, I have read on the other blogs that setting it to -1 will allow unlimited but it didn't work for me.
I tried putting this in application.properties
but was of no help
spring.servlet.multipart.enabled=true
spring.servlet.multipart.max-file-size=-1
spring.servlet.multipart.max-request-size=-1
UPDATE:
1) When I post a file using Postman which is less than 10MB my file gets uploaded and in another scenario I get
{
"timestamp": 1551270385443,
"message": "java.io.IOException: UT000020: Connection terminated as request was larger than 10485760",
"path": "v1/order/upload/"
}
which is equivalent to the response I get if I don't configure the max-file-size
and max-request-size property
in application.properties
The tutorial which I am using: https://www.callicoder.com/spring-boot-file-upload-download-rest-api-example/
2)
spring.servlet.multipart.enabled=true
spring.servlet.multipart.max-file-size=-1
spring.servlet.multipart.max-request-size=1024MB
the above configuration allows me to upload file greater than 10MB.