code: public function fromContent($content, $mime_type)
      {
          $tmpfile = tempnam(sys_get_temp_dir(), 'ucr');
          $temp = fopen($tmpfile, 'w');
          fwrite($temp, $content);
          fclose($temp);
  
          return $this->fromPath($tmpfile, $mime_type);
      }
docs: Upload file from string using mime-type.
  
  @param string $content
  @param string $mime_type
  @return File
  @throws \Exception