- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2025 06:54 AM
On the case record we have attachment icon, and while preview the attachment it is showing an error but I want to preview the file before downloading is there any possibility?
In the attachment table, the file content type is application/octet-stream
Can we change the content type to pdf?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2025 10:20 AM - edited 04-17-2025 10:20 AM
Hello @zeerodger27 ,
Please submit a case on Now Support. There is either something wrong with ServiceNow's MIME type detection, or some of the PDFs that you are uploading have an improper internal format that prevents them from being recognized as PDF files.
Regards,
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2025 01:13 PM
Hello @zeerodger27 ,
Ok, then you can change the Content Type for this file in the sys_attachment table to "application/pdf" and the preview will work.
Regards,
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2025 01:19 PM
Yes, it is working but for new attachments can we change content type by using server script or suggest me the best way to do this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2025 09:56 PM
Hello @zeerodger27 ,
I had assumed that this issue was only related to this one particular PDF file.
Or is it happening for all PDFs that are being attached? If so then something must be broken in your instance and you would have to open a Now Support case. I have tested in an OOTB instance that PDF files attached to Cases will correctly be recognized as "application/pdf" in the attachment table.
Regards,
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2025 08:08 AM
Hi @Robert H,
For some PDF files it was recognized as "application/pdf" but for some files it is "application/octet-stream" and I have written before business rule to change the content_type as below:
But it is not updating the content_type. Any suggestions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2025 10:20 AM - edited 04-17-2025 10:20 AM
Hello @zeerodger27 ,
Please submit a case on Now Support. There is either something wrong with ServiceNow's MIME type detection, or some of the PDFs that you are uploading have an improper internal format that prevents them from being recognized as PDF files.
Regards,
Robert