code: def to_dict(self):
          '''Convert the body to a :class:`dict`.
  
          Returns:
              dict: The items are:
  
                  * ``filename`` (string, None): The path of the file.
                  * ``length`` (int, None): The size of the file.
          '''
          try:
              name = self.file.name
          except AttributeError:
              name = None
  
          try:
              size = self.size()
          except OSError:
              size = None
  
          return {
              'filename': name,
              'length': size,
              'content_size': size,
          f to_dict(self):
          '''Convert the body to a :class:`dict`.
  
          Returns:
              dict: The items are:
  
                  * ``filename`` (string, None): The path of the file.
                  * ``length`` (int, None): The size of the file.
          '''
          try:
              name = self.file.name
          except AttributeError:
              name = None
  
          try:
              size = self.size()
          except OSError:
              size = None
  
          return {
              'filename': name,
              'length': size,
              'content_size': size,
          }
docs: Convert the body to a :class:`dict`.
  
          Returns:
              dict: The items are:
  
                  * ``filename`` (string, None): The path of the file.
                  * ``length`` (int, None): The size of the file.