Hi Satyendra,

This is because client-side Restlet doesn't support multi-part yet. This is 
planned for Restlet 1.2 though:

"Support composite representations"
http://restlet.tigris.org/issues/show_bug.cgi?id=71

For now, I would suggest to use Apache HTTP client directly:
http://hc.apache.org/httpclient-3.x/methods/multipartpost.html

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com


-----Message d'origine-----
De : Satyendra Singh [mailto:singh_satyen...@yahoo.com] 
Envoyé : vendredi 13 février 2009 07:28
À : discuss@restlet.tigris.org
Objet : The request was rejected because no multipart boundary was found

I can upload the file successfully from the browser (html) but getting the 
exception on server side while uploading a same file using the restlet client.

org.apache.commons.f​ileupload.FileUpload​Exception: the request was rejected 
because no multipart boundary was found

The Client code is:

Request request = new Request();
ChallengeResponse auth = new 
ChallengeResponse(Ch​allengeScheme.HTTP_B​ASIC,"16512002000","​");
request.setChallenge​Response(auth);
request.setReferrerRef("http://127.0.0.1/";);
Reference reference = new 
Reference("http://localhost:808​0/cas/subscriber/pho​ne/1.651.2001000/fam​ilysubmailbox/2/uplo​ad/greeting/1/en-us/​";);
request.setResourceR​ef(reference);
             

// Action: POST
request.setMethod(Method.POST);
FileRepresentation oFileRepresentation = 
      new FileRepresentation("​C:\\AA.pdf", MediaType.MULTIPART_ALL, 10);
request.setEntity(oF​ileRepresentation);


Client client = new Client(Protocol.HTTP);
Response response = client.handle(request);
System.out.println(r​esponse.getStatus())​;

Kindly help me out from this issue.

Thanks,
Satyendra

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1149253

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1186223

Reply via email to