You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2018/07/16 09:06:59 UTC
[incubator-servicecomb-docs] branch master updated: fix the modify
of file upload (#20)
This is an automated email from the ASF dual-hosted git repository.
liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-docs.git
The following commit(s) were added to refs/heads/master by this push:
new 25b46d0 fix the modify of file upload (#20)
25b46d0 is described below
commit 25b46d0496a96ebcf94c8f958742a8f9d6da6c8f
Author: weichao <30...@users.noreply.github.com>
AuthorDate: Mon Jul 16 17:06:57 2018 +0800
fix the modify of file upload (#20)
* modify file upload
* fix the modify of upload file
---
java-chassis-reference/zh_CN/general-development/file-upload.md | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/java-chassis-reference/zh_CN/general-development/file-upload.md b/java-chassis-reference/zh_CN/general-development/file-upload.md
index d72bffe..0f99b7b 100644
--- a/java-chassis-reference/zh_CN/general-development/file-upload.md
+++ b/java-chassis-reference/zh_CN/general-development/file-upload.md
@@ -13,6 +13,7 @@ jaxrs开发模式:
springmvc开发模式:
* 支持servlet定义的javax.servlet.http.Part类型,也支持org.springframework.web.multipart.MultipartFile类型
+
* 两种数据类型功能是一致的,MultipartFile的底层也是Part
* 两种数据类型可以混合使用,比如第一个参数是Part,第二个参数是MultipartFile
@@ -21,13 +22,13 @@ springmvc开发模式:
注意:
-* 先配置文件上传临时目录,默认为null不支持文件上传
+* 先配置文件上传临时目录,默认为null不支持文件上传,文件上传请求Content-Type必须为multipart/form-data
* 同名参数只支持一个文件
* 支持一次传输多个不同参数名的文件
-* 通过MultipartFile或Part打开流后,若上传出错,可能导致临时文件无法被删除,此时可手动清除临时目录下的残留临时文件
+* 通过MultipartFile或Part打开流后,记得关闭,否则上传的临时文件会无法删除,最终导致上传临时目录被撑爆
Springmvc模式下的代码样例: