code: def add(self, filename, stream, content_type=None):
          
          # Guess file Content-Type or default
          content_type = content_type or mimetypes.guess_type(filename)[0] or 'application/octet-stream'
  
          response = self._record._swimlane.request(
              'post',
              'attachment',
              files={
                  'file': (filename, stream, content_type)
              },
          )
  
          # Returns raw attachment data as list with single element
          raw_attachment_data = response.json()[0]
  
          attachment = Attachment(self._record._swimlane, raw_attachment_data)
          self._elements.append(attachment)
  
          self._sync_field()
  
          return attachment
docs: Upload a new attachment, and add it to current fields raw data to be persisted on save
          
          Can optionally manually set the content_type, will be guessed by provided filename extension and default to 
          application/octet-stream if it cannot be guessed