title: Can you request an object from S3 without knowing its extension?
body: <p>Say I have a bucket called <code>uploads</code> with two directories, both of which contain images.</p>
  
  <ol>
  <li><p>The first directory, called <code>catalog</code>, has images with various extensions (<code>.jpg</code>, <code>.png</code>, etc.)</p></li>
  <li><p>The second directory, called <code>brands</code>, has images with <em>no</em> extensions.</p></li>
  </ol>
  
  <p>I can request <code>uploads/catalog/some-image.jpg</code> and <code>uploads/brands/extensionless-image</code>, and they both return an image as I expect.</p>
  
  <p>We're already using a third-party service, <a href="https://www.imgix.com/" rel="nofollow">imgix</a>, which is just an image-processing CDN that links to the S3 bucket so that we can request, say, a smaller or cropped version of the image in the bucket.</p>
  
  <p>Ideally, I'd like to keep the images and objects in their current formats in the bucket, but I would like the client-side to be agnostic about which file it is requesting. In other words, I'd like to request <code>some-image</code>, and even though it may or may not actually have an extension in the bucket, I'd still like to somehow "intelligently guess" the image I'm requesting. We'll also assume that there are <em>no collisions</em>, i.e., there will never be an image <code>some-image.jpg</code> and <code>some-image</code> with both the same name (our objects are named with a collision-less algorithm).</p>
  
  <p>This is what I've tried:</p>
  
  <ul>
  <li><p>Simply request images in one directory by their extension, and the images in the other bucket without their extension (however, even though the policy is the same of requesting an image, the mechanism has to be implemented in two different ways. I would like a singular mechanism)</p></li>
  <li><p>Another solution is to programmatically remove the extensions from all the images in <code>catalog</code> and re-sync the bucket</p></li>
  </ul>
  
  <p>Anyone run into something similar before? Thoughts?</p>