diff options
author | Vitaly Takmazov | 2016-12-08 16:14:34 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-12-08 16:59:04 +0300 |
commit | 34f9a7dad5535870486edb304ee8043381f7cbdd (patch) | |
tree | 1c5d903f92d7383d2a6700947e64d976a68c0cd1 /juick-api/src/main/java/com/juick/api/configuration | |
parent | 7e954500ee1b68ad07e2b0bda4eb549ee99167b4 (diff) |
juick-api: fix upload
Diffstat (limited to 'juick-api/src/main/java/com/juick/api/configuration')
-rw-r--r-- | juick-api/src/main/java/com/juick/api/configuration/ApiMvcConfiguration.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/juick-api/src/main/java/com/juick/api/configuration/ApiMvcConfiguration.java b/juick-api/src/main/java/com/juick/api/configuration/ApiMvcConfiguration.java index 549de8bc..5a953c1f 100644 --- a/juick-api/src/main/java/com/juick/api/configuration/ApiMvcConfiguration.java +++ b/juick-api/src/main/java/com/juick/api/configuration/ApiMvcConfiguration.java @@ -2,11 +2,13 @@ package com.juick.api.configuration; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.web.multipart.commons.CommonsMultipartResolver; import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; @@ -38,4 +40,10 @@ public class ApiMvcConfiguration extends WebMvcConfigurationSupport { converters.add(converter); super.configureMessageConverters(converters); } + @Bean + public CommonsMultipartResolver multipartResolver() { + CommonsMultipartResolver resolver = new CommonsMultipartResolver(); + resolver.setMaxUploadSize(10000000); + return resolver; + } } |