I want to display an alert when the size of an attachment exceeds 18MB.

hkriwk1
Tera Contributor

When you create an email from the case form, you can compose it in a new tab.
I want to implement a mechanism where, if you attach a file in that tab and its size exceeds 18MB, a popup appears.
How can these be achieved?

hkriwk1_0-1757473271449.png

 

3 REPLIES 3

Shruti D
Tera Guru

Hello @hkriwk1,

Please refer below links:
 Attachment size pop up 

Attachment limit properties


Please Mark Correct ✔️
 if this solves your query and also mark Helpful 👍
 if you find my response worthy based on the impact.

Regards,
Shruti

Ankur Bawiskar
Tera Patron
Tera Patron

@hkriwk1 

you can use before insert BR on sys_attachment table and block the insert but you can't show the info message.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Bhimashankar H
Mega Sage

Hi @hkriwk1 ,

 

By attachment property you can limit the attachment size. Add a Client Script tied to the email compose UI or use UI Script + onAttach/attachment events to detect newly added attachments and sum their sizes, then show a modal/alert if the total crosses get the value from system property.

 

For more detail

 

Please refer the below KB Articles

Email body/attachment size limit system properties 

Allowable size to a record 

 

This is Attachment limit properties &

Limit the maximum number of attachment in email 

 

 

Thanks,
Bhimashankar H

 

-------------------------------------------------------------------------------------------------
If my response points you in the right directions, please consider marking it as 'Helpful' & 'Correct'. Thanks!