Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Any image uploaded through Storage API will no open in browser when accessing it directly, instead it downloads.
I tested the same bucket by uploading an image directly and it does work in a browser but when pushed up by Storage API it does not.
Any ideas?
Love this module btw.
Comments
Comment #1
jdjeet CreditAttribution: jdjeet commentedThough I am not much into this module, I found same thing happen while I was checking the use case for my site.
You might have activate 'Access control' while creating a container, that won't generated a base url for the files in that container causing the files to be downloaded rather displaying in a new window.
Try changing that, I might be wrong.
Comment #2
netentropy CreditAttribution: netentropy commentedThere is an .htaccess file created that forces the images to download. I think this would be better as an option.
Comment #3
brentaar CreditAttribution: brentaar commentedThis behave is due to the metadata being set to "image/jpeg; charset=binary", which looks to be by design.
Comment #4
m.stentaI came across this issue, and have some more information to share.
It is actually the "Content-Disposition: attachment" header that causes the issue... not the "charset=binary" part.
A patch has gone into Storage API 7.x-1.x that provides an alter hook that other modules can use to remove the "Content-Disposition" header if they want. More info here: #1933774: No need to force Content-Disposition header.
Comment #5
m.stenta