title: Copy file from bucket1 to bucket2 in Google Cloud Storage
body: <p>I am using the following code to copy file from one storage in my cloud function:</p>
  
  <pre><code>exports.copyFile = functions.storage.object().onFinalize((object) =&gt; {
  const Storage = require('@google-cloud/storage');
  const storage = new Storage();
  const srcBucketName = 'bucket1';
  const srcFilename = object.name;
  const destBucketName = 'bucket2';
  const destFilename = 'example.png';
  
  storage
  .bucket(srcBucketName)
  .file(srcFilename)
  .copy(storage.bucket(destBucketName).file(destFilename))
  .then(() =&gt; {
    console.log(
      `gs://${srcBucketName}/${srcFilename} copied to gs://${destBucketName}/${destFilename}.`
    );
    return console.log('done!');
  })
  .catch(err =&gt; {
    console.error('ERROR:', err);
    })
   });
  </code></pre>
  
  <p>I am getting following error in log:</p>
  
  <pre><code>ERROR: { ApiError: Not Found
  at Object.parseHttpRespBody....}
  </code></pre>
  
  <p>Not sure what's missing. Any help?</p>