09-01-2014 01:53 PM
File file = new File("c:/Prueba.png");
urlResourceAlfresco = "http://" + alfrescoServer + ":" + alfrescoPort + "/alfresco/service/slingshot/profile/uploadavatar";
log.debug("Url Alfresco resource: " + urlResourceAlfresco);
FormDataMultiPart form = new FormDataMultiPart();
form.field("username", userName);
form.field("filename", "Prueba.png");
form.bodyPart(new FileDataBodyPart("filedata", file, MediaType.MULTIPART_FORM_DATA_TYPE));
webResource = client.resource(urlResourceAlfresco);
ClientResponse responseAvatar = webResource.type(MediaType.MULTIPART_FORM_DATA).post(ClientResponse.class, form);
{
"url": "\/alfresco\/service\/api\/person\/aaa1",
"userName": "aaa1",
"enabled": true,
"avatar": "api\/node\/workspace\/SpacesStore\/8d3ea206-5bf6-43e8-89be-9ecf9d026f8b\/content\/thumbnails\/avatar",
"firstName": "Nombre pruebas1",
"lastName": "Apellidos Pruebas 1",
"jobtitle": "Puesto de trabajo",…
}
09-03-2014 05:56 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.