Hi Oleg, I tried to use 4.1 but looks like it is not there on maven repository. I used mvn to get the latest version and apparently could only find 3.1 in mvn repository. I understand that I have another option of downloading the jar and add to classpath manually. Let me know if it is already available on mvn repo and the dependencies if it is.
Thanks Sunitha On Thu, Jan 7, 2010 at 4:20 AM, Oleg Kalnichevski <[email protected]> wrote: > On Wed, 2010-01-06 at 16:41 -0800, sunitha yellasinganamala wrote: > > Hi All, > > > > I am using apache commons httpClient PostMethod in conjunction with > > MultipartRequestEntity to upload a file. > > I am getting a 500 status code and when I print the Response Body I see > the > > following error: > > " javax.ws.rs.WebApplicationException: > > org.jvnet.mimepull.MIMEParsingException: Missing start boundary > > at > > > com.sun.jersey.multipart.impl.MultiPartReader.readFrom(MultiPartReader.java:203) > > .... > > " > > > > Can anyone provide any pointers on why this is cause? > > > > For your own good consider upgrading to HttpClient 4.0.1 HttpClient 3.x > is nearing end of life. I, for one, have no interest supporting it > anymore. > > Oleg > > > > Here is how my code looks like: > > HttpClient client = new HttpClient(); > > PostMethod method = new PostMethod(url); > > method.addRequestHeader("Content-Type", > "multipart/form-data"); > > method.addParameter("name", "somename here"); > > > > try { > > Part[] parts = { > > new StringPart("file","workflow.xml"), > > new FilePart(targetFile.getName(), targetFile , > > "application/octet-stream","") }; > > method.setRequestEntity(new MultipartRequestEntity(parts, > > method.getParams())); > > > > } catch (FileNotFoundException e) { > > // TODO Auto-generated catch block > > e.printStackTrace(); > > } > > int statusCode = client.executeMethod(method); > > > > > > > > Thanks > > Sunitha > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
