code: def get_filename(self, instance):
          
          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
docs: Get the filename