The error is stating that it could not find the file uploaded.
Please follow the instructions on this page http://wiki.razuna.com/display/ecp/Upload+API2.
At the bottom there is a sample code that you can modify and use.
try {
ClientConfig cc = new DefaultClientConfig();
Client client = Client.create(cc);
client.addFilter(new LoggingFilter(System.out));
WebResource webResource = client.resource(urlString);
FormDataMultiPart formDataMultiPart = new FormDataMultiPart();
formDataMultiPart.field("fileDescription","test");
formDataMultiPart.field("filename", file.getName());
formDataMultiPart.field("fa", "c.apiupload");
formDataMultiPart.field("api_key",<removed for privacy>);
formDataMultiPart.field("destfolderid", folderId);
formDataMultiPart.field("zip_extract", "1");
FileDataBodyPart fdp = new FileDataBodyPart("filedata", file,MediaType.MULTIPART_FORM_DATA_TYPE);
formDataMultiPart.bodyPart(fdp);
ClientResponse response = webResource.type(MediaType.MULTIPART_FORM_DATA_TYPE).post(ClientResponse.class, formDataMultiPart);
if (response.getStatus() != 200) {
throw new RuntimeException("Failed : HTTP error code : "
+ response.getStatus());
}
System.out.println("Output from Server .... \n");
String output = response.getEntity(String.class);
System.out.println(output);
} catch (Exception e) {
e.printStackTrace();
}
return "success";
}
i have used same code with different parameter fields and i was able to successfully upload file on other content management server but it doesn’t work with razuna.
since i was facing issue with jersey api, i tried with Apache httpclient api and file got uploaded successfully on Razuna.
can you help me in understanding what could be the issue with jersey api as i am able to perform upload on other content management system with the code mentioned above.
Sorry we can’t help any further. We are not familiar with the Jersey API and this request is beyond the scope of support that we provide without a support contract.