- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2025 03:43 AM
Hello Everyone,
I need to implement a backend validation in ServiceNow to check if an uploaded 7zip (.7z) file is password-protected or encrypted. The requirement is:
- When a 7zip file is uploaded as an attachment (e.g., in sys_attachment), we need to determine if it is encrypted.
- If the file is not encrypted, it should be removed automatically.
- This check needs to happen entirely from the backend (Server-side).
I’m looking for suggestions on:
✅ How to detect encryption in a 7zip file from ServiceNow’s backend.
✅ Any possible use of Glide APIs, Script Includes, or other ServiceNow features.
✅ Whether ServiceNow has any built-in utilities for file parsing like it does for Excel (e.g., GlideExcelParser).
Has anyone implemented something similar or knows an approach to achieve this? Any help would be appreciated!
Thanks in advance!
CC: @Ankur Bawiskar @Dr Atul G- LNG @Ravi Gaurav @Pradeep Sharma @Chuck Tomasi@Brad Bowman
Thanks
Bhushan
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2025 04:08 AM
Nothing is present OOB to check if file is password-protected or encrypted.
You will have to use custom solution by using mid server and external jar files to determine this.
OR
may be some javascript library which can be used via UI script
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2025 11:57 PM - edited 04-28-2025 02:22 AM
Hello @Ankur Bawiskar ,
For MID Server ZIP Password Protection Validation,
I have successfully completed the following setup:
Installed and validated MID Server, with 7-Zip installed at "C:\Program Files\7-Zip\7z.exe".
Created a PowerShell script in MID Server Scripts module to download attachment by sys_id, validate password protection, and send results back via ECC Queue.
Built a Business Rule on sys_attachment (after insert) to trigger ECC Queue and run the MID Server script.
Built a Business Rule on ecc_queue (after insert) to parse the MID Server response, update attachment/incident records, delete unprotected files, and toggle the "custom_field" field.
Added the "custom_field" Boolean field on the parent table (e.g., Incident) with an onChange Client Script to reload the form after processing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2025 04:08 AM
Hi @bhushannerkar I don't have background on this but let me add a fee more experts
@Sandeep Rajput @Community Alums @Mark Manders
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2025 04:08 AM
Nothing is present OOB to check if file is password-protected or encrypted.
You will have to use custom solution by using mid server and external jar files to determine this.
OR
may be some javascript library which can be used via UI script
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2025 04:34 AM
Hello Ankur,
Thanks for the information! Could you please share more details on how to implement this custom solution? Any recommended JAR files for the MID Server or JavaScript libraries for UI scripts would be really helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2025 04:39 AM
I had used this to generate a password protected zip so see if the same supports to detect if file is password protected or not
zip4j-2.11.2
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader