在Spring Boot应用程序中针对多部分API设置不同的文件/请求大小限制。

huangapple 未分类评论48阅读模式
英文:

Different File/Request size limit in in spring boot application for multipart APIs

问题

我已经在配置属性中设置了文件大小,并且它适用于所有的多部分 API。我的要求是允许特定的 API 上传较大的文件大小,但我不想在全局标签上进行设置。是否有办法让我在不同的 API 上指定不同的文件和请求大小限制?

spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=10MB
英文:

I have set file size below config properties and It's applicable to all multipart APIs. My requirement is to allow a specific API to upload large file size which I don't want to set on global label. Is there any way that I can specify different file and request size limit on different APIs?

spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=10MB

huangapple
  • 本文由 发表于 2020年5月4日 19:30:01
  • 转载请务必保留本文链接:https://java.coder-hub.com/61591198.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定