File type and size restriction

Naman Jain2
Mega Expert

Hello,

i have an requirement to restrict the file size and file type when user uploads the file in a catalog item. I want this restriction for a particular catalog item hence i cannot use system properties. 

I believe this could be achieved using script, but i am unaware how and what to do

1 ACCEPTED SOLUTION

Aniket Narode1
Tera Expert

Hello @Naman Jain2 

 

you can achieve this using before Insert Business rule on sys_attachment and add you're catalog condition in BR condition filed which will allow BR Tobe triggered only when you're condition meet.

rest of the logic you can add in script. like check the attached file byte if its greater then abort() else save attachment.

 

I hope this will resolve you're issue. If its resolve you're issue them please mark this as Helpful.

 

Thanks

Aniket

View solution in original post

1 REPLY 1

Aniket Narode1
Tera Expert

Hello @Naman Jain2 

 

you can achieve this using before Insert Business rule on sys_attachment and add you're catalog condition in BR condition filed which will allow BR Tobe triggered only when you're condition meet.

rest of the logic you can add in script. like check the attached file byte if its greater then abort() else save attachment.

 

I hope this will resolve you're issue. If its resolve you're issue them please mark this as Helpful.

 

Thanks

Aniket