title: How can I upload files to an S3 bucket with dots in its name using the PHP SDK?
body: <p>I'm trying to upload files to my bucket using a piece of code like this:</p>
  
  <pre class="lang-php prettyprint-override"><code>$s3 = new AmazonS3();
  $bucket = 'host.domain.ext'; // My bucket name matches my host's CNAME
  
  // Open a file resource
  $file_resource = fopen('picture.jpg', 'r');
  
  // Upload the file
  $response = $s3-&gt;create_object($bucket, 'picture.jpg', array(
      'fileUpload' =&gt; $file_resource,
      'acl' =&gt; AmazonS3::ACL_PUBLIC,
      'headers' =&gt; array(
          'Cache-Control'    =&gt; 'public, max-age=86400',
      ),
  ));
  </code></pre>
  
  <p>But I get the "NoSuchBucket" error, the weird thing is that when I query my S3 account to retrieve the list of buckets, I get the exact same name I'm using for uploading <strong>host.domain.ext</strong>.</p>
  
  <p>I tried creating a different bucket with no dots in the name and it works perfectly... yes, my problem is my bucket name, but I need to keep the FQDN convention in order to map it as a static file server on the Internet. Does anyone know if is there any escaping I can do to my bucket name before sending it to the API to prevent the dot crash? I've already tried regular expressions and got the same result.</p>