Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS /

Allowed file types in ModelAdmin field


Reply


987 Views

Avatar
timwjohn

Community Member, 98 Posts

9 June 2010 at 10:07pm

I've looked into this before and haven't had much luck. I'm sure there are people out there that have wanted to do the same thing, so I'm resurrecting the question!

How can you limit the allowed extensions in a FileIframeField in ModelAdmin on the client side? I.e. set the extensions in the 'Files of type' combo in the file upload dialogue.

I've been able to do this on server side using a validator (i.e. an invalid file extension is discarded upon upload), but it would be much nicer if the files were automatically filtered in the dialogue before the upload. But how?