1

We are working on sitecore 10.3 XM. We want to apply a validation in the file upload field so that it takes only the .pdf extension files with size less than 2MB.

I was trying to implement the existing validation but I was not able to find how this validation works enter image description here

I am not able to get the required result. Please guide on how to implement the required validation.

1 Answer 1

0

The control allows you to restrict the file type and the size. You can configure this like below.

If you wish to restrict the file upload to certain file types, you can enable the ContentType Validator.

When enabled, you need to fill in the Allowed Content Types field and add the content types you wish to allow. Add multiple content types on separate rows.

enter image description here

With the file size validator, you can limit the maximum allowed file size of the uploads. The value is in bytes and is validated client and server side.

enter image description here

Ref Link: https://sitecore-forms-extensions.readthedocs.io/en/stable/contenteditordoc/customfields/fileupload/

Hope this helps.

3
  • @Harshit You need to add it into the allowed content type as given in the first image Sep 1, 2023 at 11:03
  • Thanks @Sumit But I don't see the ContentType Validator in the File upload validation do I need to do the customization or any other options available ? Sep 3, 2023 at 11:21
  • @HarshitGupta Check if you find the field name called Limit file types. I checked it in Sitecore 10.2 version Sep 4, 2023 at 6:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.