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

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -