def _handle_uploaded_file(self, field_name):
        try:
            file = self.files[field_name]
            filepath = self._get_upload_name(file.name)
        except KeyError:
            return ''
        destination = open(settings.MEDIA_ROOT + filepath, 'wb+')
        for chunk in file.chunks():
            destination.write(chunk)
            destination.close()
        return settings.MEDIA_URL + filepath
Process an uploaded file
dataset/ETHPy150Open treeio/treeio/treeio/infrastructure/forms.py/ItemForm._handle_uploaded_file