I took a stab at this, and was able to get a custom-built version of the plugin working for me locally: it uploads files to S3 with content-type set appropriately which makes them properly viewable in the browser (for inline file types such as text/plain and text/html) instead of always forcing them to be downloaded.
This took changes to both the artifact-manager-s3 and apache-httpcomponents-client-4-api-plugin repositories, since I had to ensure when the plugin performs an HTTP upload it also specifies the "Content-Type" header and I used a new method signature in RobustHTTPClient to do so.
My changes can be viewed at:
While, as I said, a custom plugin that has these changes appears to do the right thing for me and I also added several tests to verify uploads to (and subsequent downloads from) S3 are setting the content-type now, this is my first contribution to the project so I might well have missed something. Any suggestions or feedback welcome... I hope it at least provides a starting point for a fix to this issue, if nothing else.
MutableContentMetadata.setContentType? But Jenkins has no API for detecting content type of files.
Ideally VirtualFile.toExternalURL would allow you to pass a “view mode” parameter requesting a content type…if S3 supports that.