minimum upload function from https://github.com/axelpale/minimal-django-file-upload-example