Need to restrict the attachment variable only able to upload png and jpg images, and the size would be below 2mb

Rashida Banu
Giga Contributor

Hi Team,

In the catalog item i have field called 'image' (type is attachment).

in that i need to provide the access only able to upload the images, the image format would be jpg and png.

the image size would be below 2mb.

can anyone help me with the on submit client script.

Regards,

Banu

9 REPLIES 9

Try the below in your attributes

allowed_extensions=jpg;png, max_file_size=2

Both the attributes should be separated by comma (,) 

it works fine, but when am using the wrong files i can able to submit the request.

i need to restrict the submission of request when the type is  not png and jpg and maximum limit 2 mb.

 

 

You have to set only allowed extensions over there, The system will restrict not allowed extensions by automatic

the properties should be separated by commas 

allowed_extensions=jpg;png, max_file_size=2

Hi Sai,

Can we also restrict to have only 1 attachment for the variable per request submit ?
Currently the variable allows update option and when clicked on Update it does not wipe out previous attachment and instead adds another attachment making it a multiple attachment variable. Can you please suggest anything on this?

Thanks,
Sumana