code: public function fromResource($fp)
      {
          $tmpfile = tempnam(sys_get_temp_dir(), 'ucr');
          $temp = fopen($tmpfile, 'w');
          while (!feof($fp)) {
              fwrite($temp, fread($fp, 8192));
          }
          fclose($temp);
          fclose($fp);
  
          return $this->fromPath($tmpfile);
      }
docs: Upload file from file pointer
  
  @param resource $fp
  @return File
  @throws \Exception