Wagtail customize file upload

637 Views Asked by At

I'm new in wagtail, I'm trying to customize the file upload event in admin side. How I can validate the file name (for image, document, or video) before to upload.

1

There are 1 best solutions below

0
On

One way to this would be to build a custom document model where you can override the __init__ function and raise an exception if certain file extensions are used.

http://docs.wagtail.io/en/v1.13/advanced_topics/documents/custom_document_model.html

This might be a bit heavy handed though without knowing what you are trying to do exactly.