Get the filename

def get_filename(self, instance):
        """Get the filename
        """
        filename = self.field.getFilename(instance)
        if filename:
            return filename

        fieldname = self.get_field_name()
        content_type = self.get_content_type(instance)
        extension = mimetypes.guess_extension(content_type)

        return fieldname + extension