HTTP Headers when downloading an image

Hi

I had uploaded an image file using the Files REST API and got the fileURL in the response.
When I open that URL in browser, the image is downloaded instead of showing in browser.

You have the “Content-Disposition:attachment; filename=test.png” header in the HTTP response, it forces the browser to save the file instead of showing it.

Maybe you should disable that header for image-files? How often you need to download the image by the direct link? I think almost all people expect to see the image right in the browser in this case.

Hi Alex,

You’re right, it would make sense to let the browser render the returned file. This should be true not only for images. The question is whether the server should include Content-disposition at all… but then, what will happen in this case for ZIP files, for instance?

Regards,
Mark

Hi, Mark.

As I know, browser renders everything, it can, and saves files otherwise. You can try to open any local file in browser, and see that.

Content-disposition is used to force the saving. You are right - it is useless here.

I assigned a ticket to the dev team. We will make this change in an upcoming release.

Regards,
Mark

Hi Mark,
I just noticed the same problem with .html files too.
https://api.backendless.com/2C573D98-F5FC-9825-FF16-73D421338A00/v1/files/web%2Ftest.html

Hi, Alex.

We have solved this issue. You can try it.

Regards,
Kate.