Download link - Content Disposition - file save prompt

I believe at one point this worked…

Currently selecting the download link under large images doesn’t cause images to be “downloaded” - missing prompting for saving as a file.

However it should noted that it does work here on meta and try because file downloads are handled via a CDN.

I have looked around and found that it’s even broken on @sam’s blog Discourse install:

The Content Disposition HTTP header appears to be missing

1 Like

ahhh … I think I know what that is …

@eviltrout if tagger is mounting an engine I found that engines can interfere here … we should debug this.

4 Likes

Anything we can do here for 1.2 @eviltrout?

I just checked locally and the large images downloaded file and had the Content-Disposition header.

Then I went to @Sam’s blog, clicked on the graph on this post and it also downloaded as a file. I checked the headers in Chrome and it too had the Content-Disposition

What am I missing here to reproduce this?

I wonder if this was somewhere down the line fixed, bookmarked will have a look at this

EDIT: Ignore - me - my thinking this problem still exists may be that it’s cached.

OK a bit more testing…

Note the differences between the Download links that work and the ones that don’t (i.e. .png extension).

###Post 1 (doesn’t work as expected)
Post: http://discuss.samsaffron.com/t/live-restarts-of-a-supervised-unicorn-process/80/5
Download link: http://discuss.samsaffron.com/uploads/default/76/f8b48c825c151f19.png

###Post 2 (does work as expected)
Post: http://discuss.samsaffron.com/t/announcing-rubybench-org/199
Download link: http://discuss.samsaffron.com/uploads/default/2090e0e885edd6bd40f33e3a8ed0567dfac391e6

###Post 3 (doesn’t work)
Post: http://discuss.samsaffron.com/t/call-to-action-long-running-ruby-benchmark/83
Download link: http://discuss.samsaffron.com/uploads/default/84/493197bf05a35c45.png

May also be relevant - the ones that work are topic posts by @sam - the one that doesn’t is a reply by another user.

###Reproduction for first Post link

this is somehow related to the Rails Engine being mounted. Its was very hard to debug when I started looking adding it.

You should be able to reproduce this here somehow as well, since we are using akismet. Even if you bypass the cdn for the links

EDIT

@eviltrout header appears to be missing here https://meta.discourse.org//assets-meta-cdck-prod-meta.s3.dualstack.us-west-1.amazonaws.com/original/3X/d/9/d9988c49657be1d3ade114885f695a1aa25f71ef.gif

Just to say I don’t know what might “mount an engine” - but this occurs on my instance which doesn’t have “tagger”, nor “akismet” but does have the following:

can you temporarily remove all plugins and then check if the issue is still there

Sadly not right now - I need the poll plugin - a few active polls - and this time of day is quite active this forum.

np, I think we have a repro anyway

1 Like

It looks to me like the posts that can’t be downloaded on Sam’s site don’t have the data-download-href attribute. That attribute was added about a year after that post, so I think a rebake will fix it.

2 Likes

I can confirm that a post from “Sep 12, 2014” fails to download as expected and a post from today works as expected on my instance.

Rebaking the individual (previously failing) post fixes the download link for all images in the post.

Looks like it was added here (Oct 15, 2014):

So in-terms of rebaking (if you do confirm):

  • Clear instructions to rebake perhaps should be added for the point version upgrade it effects?
  • Rebake all button in the backend (with confirmation).
  • Handling future required rebakes - possible way of flagging upgrades / updates as requiring rebaking posts.

Rebake impact question - I’ve never done a rebake only the baking that was done automatically on forum import.

The baking process at the time of import actually took ~7 days - rebaking worries me as to it’s impact on the forum…
… it continuing to be usable and backups not causing an issue when running for multiple days.

4 Likes