spring boot - Internal Server error -- Java.lang.RuntimeException:java.io.IOException: Missing initial multipart boundary, -


i trying upload picture file system. using spring boot , jetty server. getting internal server error -- java.lang.runtimeexception:java.io.ioexception: missing initial multipart boundary when trying upload picture. following piece of code

@requestmapping(value = "/setprofilepic", method = requestmethod.post)     public datumresponse<identry> setprofilepic(@requestparam("file") multipartfile file, httpservletrequest request) {      datumresponse<identry> response = new datumresponse<identry>();     if (file.isempty()) {         response.setdata(new identry("file not uploaded"));         return response;     }             try {         // file , save somewhere         byte[] bytes = file.getbytes();                     path path = paths.get("/data/pic/" + "myfile" + ".jpeg");         files.write(path, bytes);         response.setdata(new identry("you uploaded"));         system.out.println("you uploaded the.");         return response;             } catch (ioexception e) {         e.printstacktrace();     }             return response;     } 

please me understand why error coming , can possible solution.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -