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?