def get_uploaded_file_mimetype(uploaded_file):
 if (uploaded_file.content_type and (len(uploaded_file.content_type.split(u'/')) == 2) and (uploaded_file.content_type != u'application/octet-stream')):
  mimetype = uploaded_file.content_type
 else:
  mimetype = guess_mimetype(uploaded_file)
 return mimetype

def get_uploaded_file_mimetype ( uploaded_file ) : if ( uploaded_file . content_type and ( len ( uploaded_file . content_type . split ( u'/' ) ) == 2 ) and ( uploaded_file . content_type != u'application/octet-stream' ) ) : mimetype = uploaded_file . content_type else : mimetype = guess_mimetype ( uploaded_file ) return mimetype
return the mimetype of a file that was uploaded .