We now have a file in S3 that could be a HTML file. We try to make it in order that the HTML file downloads quite than renders by including metadata to the item in S3
Content material-Disposition: attachment. The issue is that whereas the
Content material-Sort: textual content/html metadata can be set, S3 appears to not return the
Content material-Disposition header, which leads to the HTML rendering.
If we take away the
Content material-Sort header then it really works, S3 will return the
Content material-Disposition header as
attachment after which the HTML file shall be downloaded as an alternative of rendered.
Ideally, we wish to protect the
Content material-Sort header whereas forcing the file to obtain as an alternative of render within the browser however unsure if it is attainable with S3, because it appears to overwrite the
Content material-Disposition header when we now have a
Content material-Sort that’s
Anybody know of this problem and if there’s a approach round it?