I want to check a file type before uploading it by:
content = self.cleaned_data['picture']
content_type = content.content_type.split('/')[0]
When I upload the picture I get an error:
'NoneType' object has no attribute 'content_type'
What can be wrong here?