title: Taking a screenshot with puppeteer and storing it in google cloud storage
body: <p>I´ll describe my end goal right away: I want to be able to take screenshots of my website with puppeteer and upload them straight to google cloud storage (with cloud functions for example).</p>
  <p>However, I've been running into an issue with actually uploading the file if I do not give a path to locally store it. This is the code I have:</p>
  <pre><code>(async () =&gt; {
    const browser = await puppeteer.launch({headless: true, args: ['--no-sandbox', '--disable-setuid-sandbox']});
    const page = await browser.newPage();
    await page.goto('https://google.com');
    const filename = await page.screenshot();
  
  
      await storage.bucket(bucketName).upload(filename, {
          gzip: true,
  })
    
  
  console.log(`${filename} uploaded to ${bucketName}.`);
  await browser.close();
  })();
  </code></pre>
  <p>I have tried a variety of things like encoding the image differently and converting it from a buffer to a string but I keep running into the same two errors, either:</p>
  <ul>
  <li>The &quot;path&quot; argument must be of type string. Received an instance of Buffer, or</li>
  <li>The argument 'path' must be a string or Uint8Array without null bytes.</li>
  </ul>
  <p>I appreciate all the help I can get :D
  Kind regards</p>