SpringMVC实现文件上传 后台multipartfile接收的文件一直为null;怎么解决
SpringMVC实现文件上传后台multipartfile接收的文件一直为null;怎么解决前台代码:<formaction="/testSpringMVC/tm/fi...
SpringMVC实现文件上传 后台multipartfile接收的文件一直为null;怎么解决
前台代码:
<form action="/testSpringMVC/tm/file/upload" method="post" enctype="multipart/form-data">
<input type="file" name="uploadfile" /> <input type="submit" value="upload" />
</form>
后台接收:
@Controller
@RequestMapping("/tm/file")
@Service
public class UploadService extends AbstractRangeSupport {
private TMRangeFileSupportService fileService;
@RequestMapping("/upload")
public void upload(@RequestParam(value = "uploadfile") MultipartFile file,
HttpServletRequest request, HttpServletResponse response) {... 展开
前台代码:
<form action="/testSpringMVC/tm/file/upload" method="post" enctype="multipart/form-data">
<input type="file" name="uploadfile" /> <input type="submit" value="upload" />
</form>
后台接收:
@Controller
@RequestMapping("/tm/file")
@Service
public class UploadService extends AbstractRangeSupport {
private TMRangeFileSupportService fileService;
@RequestMapping("/upload")
public void upload(@RequestParam(value = "uploadfile") MultipartFile file,
HttpServletRequest request, HttpServletResponse response) {... 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励30(财富值+成长值)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询