From 89cd12dfdf4b1043c7c5698ea29bbff79897cb5e Mon Sep 17 00:00:00 2001 From: qibaoguang Date: Wed, 1 Apr 2015 00:05:38 +0800 Subject: [PATCH] Update 65.5. Handling Multipart File Uploads.md --- .../65.5. Handling Multipart File Uploads.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/IX. ‘How-to’ guides/65.5. Handling Multipart File Uploads.md b/IX. ‘How-to’ guides/65.5. Handling Multipart File Uploads.md index e69de29..a699490 100644 --- a/IX. ‘How-to’ guides/65.5. Handling Multipart File Uploads.md +++ b/IX. ‘How-to’ guides/65.5. Handling Multipart File Uploads.md @@ -0,0 +1,7 @@ +### 65.5. 处理Multipart文件上传 + +Spring Boot采用Servlet 3 `javax.servlet.http.Part` API来支持文件上传。默认情况下,Spring Boot配置Spring MVC在单个请求中每个文件最大1Mb,最多10Mb的文件数据。你可以覆盖那些值,也可以设置临时文件存储的位置(比如,存储到`/tmp`文件夹下)及传递数据刷新到磁盘的阀值(通过使用MultipartProperties类暴露的属性)。如果你需要设置文件不受限制,例如,可以设置`multipart.maxFileSize`属性值为`-1`。 + +当你想要接收部分(multipart)编码文件数据作为Spring MVC控制器(controller)处理方法中被`@RequestParam`注解的MultipartFile类型的参数时,multipart支持就非常有用了。 + +具体参考[MultipartAutoConfiguration](http://github.com/spring-projects/spring-boot/tree/master/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/MultipartAutoConfiguration.java)源码。