My project (elixir/phoenix) has code that displays uploaded images from S3 using signed URLs. The exact same code using S3 displayed the image inline. With Tigris it doesn’t display, but if I open the image URL in a separate tab it forces the image to be downloaded. I’m assuming it has something to do with content-type not being detected properly.
I’m going to dig into the code but thought I’d share here in case anyone else runs into something similar or in case something needs to be changed on the Tigris side.
Hi @justindotpub - yes it is due to the response header (I believe it is Content-Disposition). I will get back to you regarding this on what will be our plan to support this shortly.
profile1.png renders inline because I set content-type to image/png during put-object and profile.png downloads because the default content-type is binary/octet-stream when not set explicitly.
Thank you so much for the suggestion! It turns out this was a stupid mistake on my part. I forgot to update our content security policies image-src from Amazon to Tigris. All is well, and no code changes were needed compared to what worked in S3.
This does bring up another question… does Tigris support custom domain names, so that my CSP can allowlist our own domain instead of all of tigris? Or perhaps I need to convert to virtual host style URLs ala Public Bucket | Tigris Object Storage Documentation.
Regarding your question about custom domain names, this feature is in the works and should be ready in the next couple of days. In the meantime, you could continue using virtual host style URLs.