Unable to Download document of Correct Mimetype

Showing results for 
Search instead for 
Did you mean: 
Established Member

Unable to Download document of Correct Mimetype

Hi All,

I am facing issue in downloading document with correct mimetype.

Issue is when i create a file by uploading content of type .pdf with the API like this:-Creating a Document with APICreating a Document with API


File is created without extension though it should take extension as .pdf  as its contents but it is created without extension like below:-



If i check from node browser it mimetype is application/pdf:-



And when i tried to download it is shows of type of File is:- FILE instead of .pdf like below:-



So my query is how to get document downloaded correctly as its content is uploaded in .pdf format. So download should be as similar as .pdf.


Thanks and Regards,


2 Replies
Alfresco Employee

Re: Unable to Download document of Correct Mimetype

Hi @piyush48 

Have you tried setting the mimetype when uploading?


    "content": {
      "mimeType": "string",
      "mimeTypeName": "string"



Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!

Re: Unable to Download document of Correct Mimetype

The result seems to be expected as you are not passing the extension in the name. "name" input param maps to cm:name property. When you pass the name param, it will simply apply the input name as is to cm:name property.

This is default unless you implement a custom behavior which listens to node creation event and guess the mimetype + extension and append the extension in the name via custom code.

To verify the name property mapping, use the below url to get all the properties for the recently uploaded file based on its id (nodeRefId) returned in the upload response:

e.g., id:7cea002a-07f8-47d8-8db8-721fc0858ce3

You will see the properties like:

properties: { ..... {http://www.alfresco.org/model/system/1.0}node-uuid: "7cea002a-07f8-47d8-8db8-721fc0858ce3", {http://www.alfresco.org/model/content/1.0}name: "CMIS Tutorial", .... .... }

So in short, solution to your problem is that-> don't pass name parameter and system will automatically recognize the name of the file at the time of upload and map it to cm:name property. The cm:name will be same as the file name you are uploading. And since extension will be already present, download issue will go away.

See examples here: 



(ACSCE, AWS SAA, Azure Admin)