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.
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?
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.
We have solved this issue. You can try it.