How to set max size for attachment type field using attributes in service portal ?

Sirisha Navudu2
Giga Expert

Hi, 

      we have a requirement where we need to set the maximum size for attachment type field in service portal. could you please suggest any solution, "How to set max size for attachment type field using attributes in service portal"?.

Thanks & Regards,

Sirisha.

 

1 ACCEPTED SOLUTION

Aman Kumar S
Kilo Patron

Hey,

You will need to do the following:

Description


How to increase the attachment size limit on the Service Portal. As of now the form widget allows only the attachment of size (upto) 24 MB to be attached.

Procedure


In the form widget client controller script 

Update the line sizeLimit variable

From
 
var sizeLimit = 1024 * 1024 * 24; // 24MB
 
To
 
var sizeLimit = 1024 * 1024 * 1024; // 1GB
 
Ref Link:
 
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0692617
 
 
Feel free to mark correct, If I answered your query.

Will be helpful for future visitors looking for similar questions 🙂
Best Regards
Aman Kumar

View solution in original post

5 REPLIES 5

Aman Kumar S
Kilo Patron

Hey,

You will need to do the following:

Description


How to increase the attachment size limit on the Service Portal. As of now the form widget allows only the attachment of size (upto) 24 MB to be attached.

Procedure


In the form widget client controller script 

Update the line sizeLimit variable

From
 
var sizeLimit = 1024 * 1024 * 24; // 24MB
 
To
 
var sizeLimit = 1024 * 1024 * 1024; // 1GB
 
Ref Link:
 
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0692617
 
 
Feel free to mark correct, If I answered your query.

Will be helpful for future visitors looking for similar questions 🙂
Best Regards
Aman Kumar

Hi, how to set limit to 10MB?

Change this line to 

var sizeLimit = 1024 * 1024 * 10; // 10MB

Best Regards
Aman Kumar

thankyou for the response, but I'm looking for attribute or client script to set the limit. Is there any possibility?