Add the ability to limit file extensions for ImageField and FileField
|Reported by:||timo||Owned by:||jfilipe|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
ImageField/FileField could have an optional extension whitelist. This could default to being empty for both fields to be totally backwards compatible, or could have sensible defaults for the ImageField based on the file types supported by PIL/low. The documentation should warn that you should not rely on file extensions to determine the actual content type of files.
There are probably some existing implementations we could borrow from, for example: