how can I restrict django ImageFieldFile to accept input only Image files from browser?
I've used d开发者_如何学Gojango ImageFieldFile, from django.db.models.fields.files import ImageFieldFile
now I want to restrict the user to use only Image files when uploading from browser
Try this http://www.djangosnippets.org/snippets/1303/
and (regarding your comment below) if you want client-side validation, take a look at this thread on the topic
NB: relying on client side validation only is not going to be safe enough. If you're concerned about people uploading other file types, you need to also validate on the server.
精彩评论