spring mvc图片上传,怎么在Controller中接收?不用上传的,只用接收?

图片说明
就在红色框框里接收,或者在这个方法里接收,就好了,后面有个方法给接口就行了,求大神!在线等
大神写好的接口,我只用上传就好了
配置如下
<?xml version="1.0" encoding="UTF-8"?>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
">

<!-- 自动扫描且只扫描@Controller -->
<context:component-scan base-package="com.wadata.hspjkpt.v1.xt.web.controller"/>
<mvc:annotation-driven>
    <mvc:argument-resolvers>
        <bean class="com.wadata.hspjkpt.v1.interceptor.CommonHandlerMethodArgumentResolver" />
    </mvc:argument-resolvers>
    <mvc:message-converters>
        <bean class="org.springframework.http.converter.StringHttpMessageConverter">
            <property name="supportedMediaTypes">
                <list>
                    <value>text/plain;charset=UTF-8</value>
                    <value>application/javascript;charset=UTF-8</value>
                    <value>text/css;charset=UTF-8</value>
                </list>
            </property>
        </bean>
        <bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
            <property name="supportedMediaTypes">
                <value>text/plain;charset=UTF-8</value>
            </property>
        </bean>
    </mvc:message-converters>
</mvc:annotation-driven>


<!-- 容器默认的DefaultServletHandler处理 所有静态内容与无RequestMapping处理的URL -->
<mvc:default-servlet-handler/>

<!-- 定义无需Controller的url<->view直接映射 -->
<mvc:view-controller path="/xzzx*" view-name="redirect:/" />

UTF-81073741824

在springmvc.xml文件中配置一个CommonsMultipartResolver 的bean,然后前台上传时候命名name=“file”,在 Controller方法
public void uploadFile(@RequestParam("file") CommonsMultipartFile files){
for(CommonsMultipartFile file:files){
if(!file.isEmpty){
//在此操作上传
}else{
System.out.println("文件上传失败,请确定文件是否正确");
}
}

}

public String save(@RequestParam("file") MultipartFile path,HttpServlet request,@ModelAttribute Pic pic,Model model){
String serverPath = request.getSession().getServletContext().getRealPath(FILE_PATH);
if(!path.isEmpty()){
String picName = "filename";
File target = new File(serverPath,picName);
if(!target.exists){
target.mkdirs();
}
try{
//保存文件
path.transferTo(target);
}catcg(Exception e){
return "fail";
}

            return "success";
    }

}

配置文件中加上如下
<bean id="multipartResolver"
    class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
    <property name="defaultEncoding">
        <value>UTF-8</value>
    </property>
    <property name="maxUploadSize">
        <value>1073741824</value>
    </property>
</bean>
后端代码这样拿,memberFile为file的name
    @RequestMapping("/batchInsertMember")
@ResponseBody
public String tobatchInsertMember(HttpServletRequest request,String memberCode)  {
    String operateName = getUserInfo(request);
    logger.info(operateName+"批量导入会员start");
    String fileName = "";
    MultipartFile file = null;
    MultipartHttpServletRequest multipartRequest = null;
    multipartRequest = (MultipartHttpServletRequest) request;

    file = multipartRequest.getFile("memberFile");
            }