Attachment Variable max_file_size for less than 1mb
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2022 10:44 AM
Hello,
Knowing that we can set attachment variables of a catalog item such as max_file_size and allowed_extensions. Does anyone know a way to limit the max file size to a value of less than 100kb? (Less than 1mb)?
It would seem the max_file_size is in mb's and I've tried values like max_file_size=0.1 but it does not work.
This would be easier than writing a business rule....
If this is not possible, does anyone have an example to limit a portal catalog attachment size to less than 100kb before a user clicks "submit"?
Cheers,
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2022 10:52 AM
Business rule to validate attachment size will work for you.
I answered with the code in below thread
https://community.servicenow.com/community?id=community_question&sys_id=9bf278ccdb2fe740fa192183ca96195d
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2022 10:56 AM
Hello Gerrity,
Did you tried to restrict it using system properties? Use "com.glide.attachment.max_size" this property.
Please mark it helpful and mark it as Correct answer if it resolves your issue.
Regards,
Palak Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2022 11:33 AM
Hi Palak,
How does one use the system properties "com.glide.attachment.max_size" are you talking about writing a macro?
CHeers,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2022 12:06 PM
Property approach will be for all attachments on platform. If you want it to be specific look for approach as suggested by Sachin