文件上传
2021-04-02 04:26
标签:ati set double required Servle tps 系统错误 tip 文件上传 单个文件上传: 多个文件上传: 文件上传 标签:ati set double required Servle tps 系统错误 tip 文件上传 原文地址:https://www.cnblogs.com/zeevy/p/12557230.html// 通过MultipartFile获取上传的单个文件流
public @ResponseBody String uploadFile(@RequestParam(value = "file", required = false) MultipartFile mFile, String relativedId,
String strRelativedType, String strDesc) {
ResponseData ajaxObject = new ResponseData();
try {
NjAttach attach = attachService.uploadFile(mFile, relativedId, strRelativedType, strDesc);
ajaxObject.setMessage(attach.getStrName() + "文件上传成功");
ajaxObject.setStatusCode(AjaxObject.STATUS_CODE_SUCCESS);
Map//通过HttpServletRequest获取文件流
public String uploadListFile(HttpServletRequest request, String relativedId, String relativedType) {
AjaxObject ajaxObject = new AjaxObject();
try {
MultipartHttpServletRequest multiRequest = (MultipartHttpServletRequest) request;
Map