How to resolve MIME type issue after adding the extension under glide.attachment.extensions property?

ias
Tera Contributor

I have recently added the file extensions (cbl, cob, wsdl, ccp, cpy, raml) under glide.attachment.extensions property to enable user add those files in the ServiceNow as a valid attachment. However, after adding them the file extensions cbl, cob, wsdl can be attached but ccp, cpy, raml cannot be attached and getting following error

File type not permitted or mime type does not match the file content

I tried to add them under "glide.security.mime_type.aliasset" property using the existing entries in it but it did not help and possibly the entries used is not applicable to the new file extensions.

Please help to resolve the error

8 REPLIES 8

Henrik Jutterst
Tera Guru

This post was helpful and it solved an issue that I had with a new file extension being uploaded. The extension was added but I still got the error message and this post solved it.

However, disabling this property is not recommended by ServiceNow, and I found this KB-article to solve the issue and still having mime types enabled.

Therefore I would strongly suggest adding the mime types as described in this post since disabling this property will effect the hardening of your instance.

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0820753

Kind regards

Hello!

 

I'm not able to access the article, but we would like to allow p7m files.

 

In glide.attachment.extensions -- added p7m extension and then created the property glide.security.mime_type.extension_mapping and added value p7m=text/plain, still get the same error.

 

XXXX.pdf.p7m: File type not permitted or mime type does not match the file content

 

Request some inputs on this..

If you haven't already resolve this (highly likely as your post was over a year ago!) - check Henrik's response.

 

Creating the new extension_mapping property worked for me.

PattenM1
Giga Contributor

was having this issue too - however Henrik Jutterst's solution helped me solve it.

 

Creating the glide.security.mime_type.extension_mapping as a string and setting the value to the MIME type you'd like to map the file format to, seems to have worked for me. 🙂

 

Thanks Henrik!