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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Allowed file types in ModelAdmin field


Go to End


1478 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?