Skip to content

Commit 0f38c83

Browse files
committed
Configure MultipartAutoConfiguration and set file upload limits.
1 parent cbbd659 commit 0f38c83

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/main/resources/application.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,9 @@ spring.profiles.active: test
55
spring.main.show-banner: false
66

77
spring.jmx.enabled: false
8+
9+
# See for details: http://docs.spring.io/autorepo/docs/spring-boot/current/api/org/springframework/boot/autoconfigure/web/MultipartProperties.html
10+
multipart.location: /tmp
11+
multipart.max-request-size: 10Mb
12+
multipart.max-file-size: 5Mb
13+
multipart.file-size-threshold: 1Mb

src/main/webapp/WEB-INF/web.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,6 @@
4444
</param-value>
4545
</init-param>
4646
<load-on-startup>1</load-on-startup>
47-
<!-- See http://docs.oracle.com/javaee/6/tutorial/doc/gmhal.html for details -->
48-
<multipart-config>
49-
<location>/tmp</location>
50-
<max-request-size>10485760</max-request-size> <!-- 10Mb -->
51-
<max-file-size>5242880</max-file-size> <!-- 5 Mb -->
52-
<file-size-threshold>1048576</file-size-threshold><!-- 1 Mb -->
53-
</multipart-config>
5447
</servlet>
5548

5649
<servlet-mapping>

0 commit comments

Comments
 (0)