How can we validate whether attachment is PDF or word file or image or excel file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2024 02:12 AM
Hi,
for some of the users i want to only image formats
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2024 02:37 AM
Maybe subscribe to this one: https://www.servicenow.com/community/itsm-forum/how-can-we-validate-whether-attachment-is-pdf-or-wor...
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2024 02:51 AM
Hi @kranthi2 ,
I think this is not reproducible. Cause we cannot verify the extension/type of the attachment before it has been uploaded and stored in the "sys_attachment" table. In your case, we can do one thing, we can delete the uploaded attachment if it's type doesn't comply with the current logged in user/group once it is stored in the attachment table and display an error message to the user.
Kindly mark my response helpful and correct if it helps your understanding.
Shivam Jaiswal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 07:58 AM
does any of this validation actually examine the coding of the file of just look at the attachment's extension value? ie- can it check for if someone just changed the name of the file from virusmalware.exe to safe.pdf ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2024 12:13 AM
No. An attachment is an attachment and the extension is evaluated. The Antivirus config will take care of content that can be dangerous, no matter the extension.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark