docs: def attachments_ping(request):
      """Heartbeat view for the attachments backend.
      :returns: ``True`` if succeeds to write and delete, ``False`` otherwise.
      """
      # Do nothing if server is readonly.
      if asbool(request.registry.settings.get('readonly', False)):
          return True
  
      # We will fake a file upload, so pick a file extension that is allowed.
      extensions = request.attachment.extensions or {'json'}
      allowed_extension = "." + list(extensions)[-1]
  
      status = False
      try:
          content = cgi.FieldStorage()
          content.filename = HEARTBEAT_FILENAME + allowed_extension
          content.file = BytesIO(HEARTBEAT_CONTENT.encode('utf-8'))
          content.type = 'application/octet-stream'
  
          stored = utils.save_file(request, content, keep_link=False, replace=True)
  
          relative_location = stored['location'].replace(request.attachment.base_url, '')
          request.attachment.delete(relative_location)
  
          status = True
      except Exception as e:
          logger.exception(e)
      return status