|  |  |  | 
|---|
|  |  |  | MultipartFile file = multipartRequest.getFile(fileNames.next()); | 
|---|
|  |  |  | String fileName = file.getOriginalFilename(); | 
|---|
|  |  |  | String suffix = fileName.substring(fileName.lastIndexOf(".")); | 
|---|
|  |  |  | if ( !StringUtils.equalsIgnoreCase(suffix, ".jpg") || !StringUtils.equalsIgnoreCase(suffix, ".png")) { | 
|---|
|  |  |  | if ( !StringUtils.equalsIgnoreCase(suffix, ".jpg") && !StringUtils.equalsIgnoreCase(suffix, ".png")) { | 
|---|
|  |  |  | context.put("code", 0); | 
|---|
|  |  |  | context.put("message", "对不起,文件格式上传有误!"); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | upload(multipartRequest, response, folder + "/", | 
|---|