Spring Boot: change the upload max size for a single endpoint

Viewed 89

It is possible to define globally the maximum file size and request size in Spring Boot by using:

# Spring Boot v1
spring.http.multipart.max-file-size=10MB
spring.http.multipart.max-request-size=10MB

# Sprint Boot v2
spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=10MB

But is it possible to override the global limit for a specific endpoint?

For instance, I want a default limit of 10MB but for a specific endpoint, I want to be able to upload files as big as 1GB. Is this possible?

1 Answers

To my knowledge thats not possible. But you could define the default upload size as 1 GB and create a JavaScript function that validates the upload size of the files

Related