Skip to content

Instantly share code, notes, and snippets.

@jrosebr1
jrosebr1 / validators.py
Created March 20, 2012 20:04 — forked from dokterbob/validators.py
Validator for files, checking the size, extension and mimetype for Django.
# @brief
# Performs file upload validation for django. The original version implemented
# by dokterbob had some problems with determining the correct mimetype and
# determining the size of the file uploaded (at least within my Django application
# that is).
# @author dokterbob
# @author jrosebr1
import mimetypes