I am having problems when i try to send a great file. When the file is small there is not problem.
Controller
@SuppressWarnings({ "unchecked", "rawtypes" })
@RequestMapping(value = "newFile", method = RequestMethod.POST)
@ResponseBody
public JSONObject newFile(final HttpSession session, final HttpServletResponse response,
@RequestPart("document") final DocumentAjusteDTO dto, @RequestPart("file") final MultipartFile file)
throws IOException {
js
formDoc.append('file', (file.files[0]));
var documentData = {
tipo: tipo,
periodo: periodo
};
formDoc.append('document', new Blob([JSON.stringify(documentData)], {
type: "application/json"
}));
var ajaxData = {
data: formDoc,
sendMethod: 'POST',
target: 'new_file',
properties: {
contentType: false,
processData: false
},
callbackSuccess: function (e) {
....
}
};
Ajax.call(ajaxData);
}
};
when the file is< 5mb ok. file > 5mb ko
this is tomcat log
HandlerMethod details:
Controller [com.isb.hpa.ajustes.web.controllers.AjustesController]
Method [public org.jose4j.json.internal.json_simple.JSONObject com.isb.hpa.ajustes.web.controllers.AjustesController.newFile(javax.servlet.http.HttpSession,javax.servlet.http.HttpServletResponse,com.isb.hpa.logic.rest.beans.DocumentAjusteDTO,org.springframework.web.multipart.MultipartFile) throws java.io.IOException]
org.springframework.web.multipart.support.MissingServletRequestPartException: Required request part 'document' is not present
at ....