AnsweredAssumed Answered

Upload file with properties (multiple value)

Question asked by ally311 on Jan 19, 2018
Latest reply on Jan 22, 2018 by janv

I'm trying to upload a file to my alfresco repository (using the rest api) along with some custom properties.

I'm having no trouble with the file or properties that only have only one value, but when I try and input values for the properties with multiple values, I keep getting errors.

 

attached is the code I am using to build the entity to send. all of the properties I am sending are d:long in the repository, but stringbody seems to work for the other values.

 

any advice on how I can set these multi-value properties? - preferably without having to make a second call to update

 

MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder.create();
multipartEntityBuilder.addPart("filedata", filedata);
for(NameValuePair pair : metadataList){
    ContentBody textContent = new StringBody(pair.getValue(), ContentType.TEXT_PLAIN);
    multipartEntityBuilder.addPart(pair.getName(), textContent);
}
return multipartEntityBuilder.build();

Outcomes