Attachment Variable max_file_size for less than 1mb

Gerrity
Tera Expert

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,

9 REPLIES 9

sachin_namjoshi
Kilo Patron
Kilo Patron

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

Palak Gupta
Tera Guru
Tera Guru

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

Hi Palak,

How does one use the system properties "com.glide.attachment.max_size" are you talking about writing a macro? 

 

CHeers,

Property approach will be for all attachments on platform. If you want it to be specific look for approach as suggested by Sachin