Estoy tratando de cargar un archivo en reaccionar nativo usando axios a un backend de servicio de primavera.
const sf5 = async () => { let fd = new FormData(); fd.append("file", imgimg.uri) const eeefile = await instance.post('/uploadfile', { body: fd }, {headers:{ "Content-Type": "multipart/form-data" }}).then(function (response) { //console.log('~~~~~~~~~~~~~~~' + random_val) //console.log(response); }); }Sin embargo, Spring Framework rechaza la solicitud diciendo
[dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.web.multipart.MultipartException: Current request is not a multipart request]Intenté colocar un punto de interrupción en la clase de aplicación de primavera. Sin embargo, la solicitud ni siquiera llegó allí.
Puedo cargar el archivo desde el navegador a través de XHR.
Cualquier indicador sería apreciada.