agea / CmisJS

A CMIS javascript library for node and browser
MIT License
38 stars 34 forks source link

Uploading file without extension does not allow mimetype to be set #45

Closed spdevlin closed 7 years ago

spdevlin commented 7 years ago

Hi there,

I am trying to upload a file to Alfresco. Due to a requirement, the alfresco document name does not have a file extension. To rectify this issue, I have been calling the createDocument function and setting the mimeType parameter. However, this mimetype value is not used as it should.

Example call:

session.createDocument(rootId, data, properties, 'application/pdf')

Weaving through the code, I find that this mimetype is passed to the _postMultipart function as the filename. This filename will always be overwritten by the value of 'cmis:name'.

From what I can see, there is no way to set the mimetype if the document name does not have a file extension.

By the way, I have tried setting 'cmis:contentStreamMimeType' but CMIS returns with a READ-ONLY PROPERTY error.