Artifacts get downloaded rather than viewed [2019.3.5 LTS]

The documentation for Artifacts says

Artifacts in Octopus provide a convenient way to collect files from remote machines, and copy them to the Octopus Server, where they can then be viewed from the web interface.

But it doesn’t work that way for OD 2019.3.5 LTS, instead when you click on a text file artifact the browser tries to download it rather than view it. I believe this is because of incorrect HTTP response headers generated by OD.

The problem is caused by OD putting ‘attachment’ in the ‘Content-Disposition’ header. You would want that to be ‘inline’. Then users can actually view Artifacts.

‘Content-Disposition: attachment; filename=“my-file.txt”; filename*=UTF-8’‘my-file.txt’

HTTP/1.1 200 OK
Cache-Control: private no-cache, no-store
Transfer-Encoding: chunked
Content-Type: text/plain
Content-Encoding: gzip
Expires: Wed, 24 Jul 2019 04:29:44 GMT
Server: Octopus Deploy/ Microsoft-HTTPAPI/2.0
Content-Disposition: attachment; filename="my-file.txt"; filename*=UTF-8''my-file.txt
X-UA-Compatible: IE=edge
Content-Security-Policy: default-src 'none'; connect-src 'self'; font-src 'self'; img-src data: 'self'; script-src eval: inline: 'self' 'unsafe-eval' 'unsafe-inline'; style-src inline: 'self' 'unsafe-inline'; worker-src 'self'; block-all-mixed-content; sandbox allow-same-origin allow-scripts allow-forms allow-popups allow-modals;
Octopus-Node: name=foo; version=2019.3.5
Referrer-Policy: no-referrer
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Server-Timing: total;dur=10
Date: Thu, 25 Jul 2019 04:29:44 GMT

Hi Aaron,

Thanks for getting in touch! I had a chat to the developers here and we all agree that downloading is the intended behaviour. I think the change we will make here is to change the wording in the documentation to be more clear on this:

Artifacts in Octopus provide a convenient way to collect files from remote machines, and copy them to the Octopus Server, where they can then be viewed downloaded from the web interface.

If you have any further thoughts here please don’t hesitate to let me know. :slight_smile:

Best regards,

Thanks Daniel, thanks for the info about the change. Any reason not to provide two links? Many artifacts are just text you want to be able to review interactively. Having to download to disk, then locate and open is a bunch of unnecessary clicks.

You could have the default link be download, and offer a view link with target=_blank that didn’t force the download on people, and displayed the file in a new tab, so doesn’t leave the OD UI?

my-artifact.txt (view)

If you wanted you could only display the view link for a few file extensions.

Hi Aaron,

I think the best option here would be to make a suggestion over at our UserVoice page. We use UserVoice to gauge community support for new ideas and features. If a suggestion gathers enough community support, we can look into its implementation into Octopus.

You are welcome to create a suggestion, or vote and comment on any existing suggestions that interest you.

Let me know if you have any further thoughts or questions here. :slight_smile:

Best regards,