1

I've set those parameters in my application.yml:

spring:
  servlet:
    multipart:
      max-file-size: -1
      max-request-size: -1

and when I run it from IDE it works fine. The problem starts when I try to run it along with spring cloud, netflix eureka, and zuul proxy. It behaves like there is no such paramteters. It always throws:

"Maximum upload size exceeded; nested exception is java.lang.IllegalStateException: org.apache.tomcat.util.http.fileupload.FileUploadBase$FileSizeLimitExceededException: The field file exceeds its maximum permitted size of 1048576 bytes.",

Shall I set it somewhere else?

EDIT: My bootstrap.yml

spring:
  profiles: docker
  application:
    name: test-service
  sleuth:
    sampler:
      probability: 1
  zipkin:
    base-url: http://zipkin:9411/
  cloud:
      config:
        discovery:
          enabled: true
          service-id: config-server
        fail-fast: true
        retry:
          initial-interval: 2000
          max-interval: 10000
          multiplier: 2
          max-attempts: 10

eureka:
  instance:
    hostname: test-service
    prefer-ip-address: true
  client:
    registerWithEureka: true
    fetchRegistry: true
    serviceUrl:
      defaultZone: http://eureka-server:8761/eureka/

management:
  endpoints:
    web:
      exposure:
        include: "*"
  endpoint:
    health:
      show-details: ALWAYS

logging:
  file: ./logs/log.log
Mariola
  • 249
  • 7
  • 16

1 Answers1

0

Faced the same issue and found the solution, post it here still anyone needs help after 3years.

If your traffic flow through the Netflix Zuul edge service, you should update the below properties in both Zuul and your file upload application service.

for spring boot 2.x and above its

spring.servlet.multipart.max-file-size=-1
spring.servlet.multipart.max-request-size=-1
Denuwan.hh
  • 56
  • 3