AnsweredAssumed Answered

How to assign a mimetype to document being created using REST API? (Alfresco 5.2)

Question asked by mikeitexpert on Jun 1, 2018
Latest reply on Jun 2, 2018 by angelborroy

hi,

 

I am wondering if there is anyway we can set/assign the content-mime type of a document being created using REST API.

 

I use the below this rest api  and I need to be able to set mimetype directly when the document is being created. 

 

Is that possible?

 

I did a few try and errors it seems that mimetype is determined based on the extension given to the name property passed to the api.

 

So if I for example use the below as the json post parameter, the mimetype becomes application/pdf but 

 

{
"name": "filename.pdf",
"nodeType": "string",

}

 

if use the below, the mimetype becomes applicaiton/image. 

 

{
"name": "filename.png",
"nodeType": "string",

}

 

 

Please advise if that can be set using REST API.

 

Thank you,

Outcomes