c# - Unable to Upload File to Spring MVC using Web API -


i attempting upload file using .net framework 4.5 , web api 3rd party client uses spring mvc handle file uploads. every attempt met error, "required multipartfile parameter 'file' not present."

has else ran issue? if how did resolve it? doesn't seem web api offers proper mechanism/container send spring recognize it.

here current code.

 uri webservice = new uri(objectinstance);              var filecontent = new bytearraycontent(system.io.file.readallbytes(httpcontext.current.server.mappath("taleotest.xml")));//new bytearraycontent(new byte[100]);             filecontent.headers.contentdisposition = new contentdispositionheadervalue("file")             {                 filename = @"c:\taleotest.xml"             };              var formdata = new formurlencodedcontent(new[]                                             {                                                 new keyvaluepair<string, string>("name", "test"),                                                 new keyvaluepair<string, string>("title", "test2")                                             });             //filecontent.add             var cookiecontainer = new cookiecontainer();             cookiecontainer.add(webservice, new cookie("authtoken", _authtoken));             var handler = new httpclienthandler() { cookiecontainer = cookiecontainer };             httpclient httpclient = new httpclient(handler);              multipartcontent content = new multipartcontent();             content.add(formdata);             content.add(filecontent);              var response = httpclient.postasync(webservice, content).result; 

have tried adding commonsmultipartresolver property value applicationcontext.xml file? http://forum.springsource.org/showthread.php?66240-problems-with-multipartfile-upload

can ensure dependencies have been correctly referenced? example of one: ie9 issue - required multipartfile[] parameter not present jquery-uploadify

might need more information , code examples provide more help, can caused many things.


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

php - MySQLi multi_query results for later use -