title: Google Cloud Storage - Invalid bucket name (PHP)
body: <p>I tried to upload a file on root in my Google cloud Storage by doing this:</p>
  
  <pre><code>$bucketName = "bucket-name.appspot.com";
          $objectName = $client_id . '_' . rand(0, 200) . '_' . $type . '.pdf';
          $storage = new StorageClient();
          $bucket = $storage-&gt;bucket($bucketName);
          $object = $bucket-&gt;upload($datas, [
              'name' =&gt; $objectName
          ]);
  </code></pre>
  
  <p>This worked and i successfully upload a <code>file($datas)</code>.</p>
  
  <p><br></p>
  
  <p>Now i created a folder in my root storage and called it <code>"contracts"</code>. So my <code>$bucketName</code> is updated to include the folder like this:</p>
  
  <pre><code>$bucketName = "bucket-name.appspot.com/contracts";
          $objectName = $client_id . '_' . rand(0, 200) . '_' . $type . '.pdf';
          $storage = new StorageClient();
          $bucket = $storage-&gt;bucket($bucketName);
          $object = $bucket-&gt;upload($datas, [
              'name' =&gt; $objectName
          ]);
  </code></pre>
  
  <p>As you can see this is now updated to: <code>$bucketName = "bucket-name.appspot.com/contracts";</code>. But this gives me this error now:</p>
  
  <pre><code>{
   "error": {
    "errors": [
     {
      "domain": "global",
      "reason": "invalid",
      "message": "Invalid bucket name: 'bucket-name.appspot.com/contracts'"
     }
    ],
    "code": 400,
    "message": "Invalid bucket name: 'bucket-name.appspot.com/contracts'"
   }
  }
  </code></pre>
  
  <p>Why is that?</p>