I'm uploading multiple pictures with different extensions (jpg, png...etc) via java Amazon TransferManager.
for example : picture1.png, picture2.jpg. I would like to serve the content without the extension, a get request to folder/picture1 would return picture1.png.
The client is an angularJs application
Previously, I was hosting all these picture on EC2 and serving it via APACHE with option Multiviews, is there something similar we can do with AmazonS3 ?
Thanks
It doesn't work that way. S3 does not impute special meaning to any portion of the object key (path + filename), so it has no concept of "extensions." (Technically, S3 has no real concept of "paths" either, but it behaves in most cases as though it does).
Of course, on the web, file extensions should have no meaning anyway -- the Content-Type
declared should be the only thing that matters, so... technically... there's no need for objects in S3 to be saved with their extension.
Save the files to S3 without the extension, set the Content-Type
correctly, and you'll have exactly the behavior you're looking for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With