Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Attachment MIME type Validation problem

Kevin179
Kilo Expert

I have set up .txt files to be allowed uploadable as attachments (among others). I also have MIME type validation turned on. When i upload a text file with an email header as the contents, the system rejects it for an unknown reason.

I turned off the validation property and uploaded the file. The attachment record indicated it was text/plain. My question boils down to how can the system recognize it as a text/plain MIME type with a .txt extension and reject it (granted it holds an email header, but how does this not match a text/plain MIME)? I can change the first line of the file and the file will upload. Anyone else see anything odd around MIME validation?

4 REPLIES 4

Sumanth16
Kilo Patron

Hi Kevin,

 

I am facing same issue from last two days

I think below information will helpful:

 

Solution:

glide.security.file.mime_type.validation system property is set to true by default in instance. When you set it to false then it will allow those type of attachments into instance.

 

Description about property from ServiceNow docs:

glide.security.file.mime_type.validation:Must be set to activate MIME type checking for uploads (all version Eureka and up). Enables (Yes) or disables (No) mime type validation for file attachments. File extensions configured via glide.attachment.extensions are checked for MIME type during upload.

Sumanth16
Kilo Patron

can you help me with how to find MIME type attachments from sys_attachment table?

Just personalize the list and add the "Content Type" field to your list.

 

Also, I am aware of the system property. Due to company policies and so forth we are unable to disable the glide.security.file.mime_type.validation property. This was more "what constitutes plaintext"

anezka_neckarov
Tera Contributor

Hi, Sumanth, 

 

you should filter content type "message/rfc822"