PNG format issue in uploading

Kartik Choumal
Tera Contributor

Hi ServiceNow Family,

 

I have a very unique issue, on my instance png format is allowed. However, when a 24-bit png image is uploaded the system throws the error:  File type not permitted or mime type does not match the file content

What is interesting is, if i upload a file type of png which is a 32-bit png, we do not have this issue and the system accepts the solution.

 

Hence, looking for a help on this case.

 

Thanks in advance!!

5 REPLIES 5

Sohail Khilji
Kilo Patron

Hi @Kartik Choumal ,

 

Alternative, why don't you convert this image online and load it to the supposed format.

 

I hope that helps 


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

It crossed my mind but in my situation it is not a good workaround as it will be the end users attaching the images and to control their behaviour would not be a good task to begin with.

aniket_hadron
Giga Expert

Hi Kartik, 

 

Restrictions may be present in system properties on permitted file type uploads. The main property 'glide.attachment.extensions' may contain in its Value field a list of file types. In this case only these file types are permitted to upload. If instead the value is empty, all file types are permitted as attachments. You can edit the value list to add or remove problematic file types.

If the above has been checked and the issue still persists, the issue is with MIME type checking. When an application searches for the MIME type of a file, it checks the filename against the MIME information files. If a match for the filename is found, the MIME type associated with the extension or pattern is the MIME type of the file. You can disable this security upload-stop feature by editing the system property 'glide.security.file.mime_type.validation' and setting its Value to 'false'.

 

Though you can always convert the image using some converter and then upload it. Obviously this would be a temporary solution.

Yes but wouldn't it bring the risk that the deactivation would impact on all the extenstion types?