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

jdjeet’s picture

Though 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.

netentropy’s picture

There is an .htaccess file created that forces the images to download. I think this would be better as an option.

brentaar’s picture

Status: Active » Closed (won't fix)

This behave is due to the metadata being set to "image/jpeg; charset=binary", which looks to be by design.

m.stenta’s picture

Issue summary: View changes
Status: Closed (won't fix) » Fixed

I 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.

m.stenta’s picture

Status: Fixed » Closed (fixed)