Hi, is is possible to define a MIME type for a document when using the REST API? We are using Content Server version 16.2.3.
The reason for the question is that when we add an Office document to Content Server using the REST API, the MIME type is showing the correct value. However, we are unable to edit the document. When changing the MIME type within the document Properties -> Specific -> MIME Type to something other than the current MIME type, and then change it back to what it was originally set, the document then becomes editable.
Here is the Java code that performs the document upload operation:
MultiPart multipartEntity = new FormDataMultiPart().field("type", type).field("parent_id", parent_id).field("name", name);
if (row.getValue().get("file") != null) {
String tempFileName = getConversion().convert(row.getValue().get("file"), String.class);
File tempFile = new File(getMetadata().calculateTempFolder(), tempFileName);
FileDataBodyPart filePart = new FileDataBodyPart("file", tempFile);
filePart.setContentDisposition(FormDataContentDisposition.name("file").fileName(name).build());
multipartEntity = multipartEntity.bodyPart(filePart);
}
return getService().post(target, Entity.entity(multipartEntity, multipartEntity.getMediaType()));
Thanks in advance.