cancel
Showing results for 
Search instead for 
Did you mean: 

Downloading files from Alfresco repository with MuleSoft CMIS connector

loshmeey
Champ in-the-making
Champ in-the-making
Hello everyone,

I am not sure is this the right place for this topic but i have no idea where else to post it.

I am developing an application with MuleSoft ESB that communicates with Alfresco repository.I have a little problem with the CMIS connector. The application uploads and downloads files from Alfresco. I connect to Alfresco trough AtomPub and use CMIS for all actions towards the Alfresco.

The problem is:
I use cmis connector to get the object from the repository and it works fine. In my flow i added i component that takes the object from the flow(cmis connector), which is of type DocumentImpl, get InputStream cast it to an Object and return it. The browser starts the download of the file but it has no idea what the file is because it has no extension attached to it.

And finally the question. What is the best way to solve this problem? How do i make browser know what the mime type of the file is?

Thanks in Advance!
1 REPLY 1

sglover
Champ in-the-making
Champ in-the-making
I presume you are calling DocumentImpl.getContentStream to get the content stream? The ContentSteam object that this method returns has a getMimeType method that will give you the mime type.