Attachment variable - Service Catalog

Vinu1
Tera Expert

Hi All,

I am having a attachment variable in a catalog item. The maximum limit of the attachment should be 20 mb.

Can anyone please let me now how to achieve this?

Thanks,

Vinu

1 ACCEPTED SOLUTION

Maik Skoddow
Tera Patron
Tera Patron

Hi @Vinu 

please see https://docs.servicenow.com/bundle/rome-servicenow-platform/page/product/service-catalog-management/... for the answer.

When submitting a catalog item request, this variable lets you upload an attachment for a question of the item. After you upload the attachment, you can also download, update, and delete it. Even when fulfilling the request, you can download, update, and delete the attachment in a requested item or catalog task. You can specify restrictions for file size and extensions using the max_file_size and allowed_extensions variable attributes. For information on these variable attributes, see Service catalog variable attributes.
Important:
  • You should specify only an integer value for the following:
    • The max_file_size variable attribute
    • The glide.sc.variable.attachment.default_max_size system property (catalog-level). The default value is 20.
  • If the max_file_size variable attribute is not specified, the glide.sc.variable.attachment.default_max_size system property value is considered as the upper limit for the attachment file size.
  • Irrespective of the file size allowed in the variable, the attachment file size cannot exceed the size specified in com.glide.attachment.max_size system property, which is applicable for attachments across Now Platform.

 

That means, the system checks in that order:

  1. Value specified at variable attribute max_file_size
  2. Value specified at system property glide.sc.variable.attachment.default_max_size
  3. Value specified at system property com.glide.attachment.max_size

 

Let me know if you have any further questions.

Kind regards
Maik

View solution in original post

3 REPLIES 3

Maik Skoddow
Tera Patron
Tera Patron

Hi Vinu

maximum allowed attachment size can only be set for the complete instance (see https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0718101) but not indivdual for an attachment variable.

Kind regards
Maik

Maik Skoddow
Tera Patron
Tera Patron

Hi @Vinu 

please see https://docs.servicenow.com/bundle/rome-servicenow-platform/page/product/service-catalog-management/... for the answer.

When submitting a catalog item request, this variable lets you upload an attachment for a question of the item. After you upload the attachment, you can also download, update, and delete it. Even when fulfilling the request, you can download, update, and delete the attachment in a requested item or catalog task. You can specify restrictions for file size and extensions using the max_file_size and allowed_extensions variable attributes. For information on these variable attributes, see Service catalog variable attributes.
Important:
  • You should specify only an integer value for the following:
    • The max_file_size variable attribute
    • The glide.sc.variable.attachment.default_max_size system property (catalog-level). The default value is 20.
  • If the max_file_size variable attribute is not specified, the glide.sc.variable.attachment.default_max_size system property value is considered as the upper limit for the attachment file size.
  • Irrespective of the file size allowed in the variable, the attachment file size cannot exceed the size specified in com.glide.attachment.max_size system property, which is applicable for attachments across Now Platform.

 

That means, the system checks in that order:

  1. Value specified at variable attribute max_file_size
  2. Value specified at system property glide.sc.variable.attachment.default_max_size
  3. Value specified at system property com.glide.attachment.max_size

 

Let me know if you have any further questions.

Kind regards
Maik

Gerrity
Tera Expert

As a follow-up question,  does anyone know how to limit the attachment variable attribute of max_file_size to less than 1mb?  Since it's in mb's decimal values don't seem to work.  

 

I'd like to limit to 100kb which would be 0.1 or max_file_size=0.1 but this doesn't seem to work (anything under 1 doesn't seem to work.

 

Any ideas?