# Download link - Content Disposition - file save prompt

**URL:** <https://meta.discourse.org/t/download-link-content-disposition-file-save-prompt/25228>\
**Category:** Bug\
**Created:** [2015年二月13日 21:36 UTC](https://meta.discourse.org/t/download-link-content-disposition-file-save-prompt/25228 "2015-02-13T21:36:23Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)\
**Post date:** [2015年二月13日 21:36 UTC](https://meta.discourse.org/t/download-link-content-disposition-file-save-prompt/25228/1 "2015-02-13T21:36:23Z")

</div>

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.  
 ![](https://global.discourse-cdn.com/meta/original/3X/0/9/092a2197ce27211f0fc57fa14e1976c452791fbb.png)

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:

> **[Live restarts of a supervised unicorn process](https://discuss.samsaffron.com/t/live-restarts-of-a-supervised-unicorn-process/80/5)**
>
> Yep, here’s one I’ve just run. At 11:04:30 I restarted the IIS app pool and at 11:05:30 I did a full restart of IIS. On both occassions there appear to be a 2-3 requests that wait for the restart to finish (~25 seconds) but the LB switches it over...

The `Content Disposition` HTTP header appears to be missing

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2015年二月13日 21:50 UTC](https://meta.discourse.org/t/download-link-content-disposition-file-save-prompt/25228/2 "2015-02-13T21:50:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2015年二月17日 13:19 UTC](https://meta.discourse.org/t/download-link-content-disposition-file-save-prompt/25228/3 "2015-02-17T13:19:56Z")

</div>

Anything we can do here for 1.2 @eviltrout?

---

<div class="post-metadata">

**Author:** ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)\
**Post date:** [2015年二月17日 20:21 UTC](https://meta.discourse.org/t/download-link-content-disposition-file-save-prompt/25228/4 "2015-02-17T20:21:37Z")

</div>

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](http://discuss.samsaffron.com/t/announcing-rubybench-org/199) 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?

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2015年二月17日 20:30 UTC](https://meta.discourse.org/t/download-link-content-disposition-file-save-prompt/25228/5 "2015-02-17T20:30:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)\
**Post date:** [2015年二月17日 20:31 UTC](https://meta.discourse.org/t/download-link-content-disposition-file-save-prompt/25228/6 "2015-02-17T20:31:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)\
**Post date:** [2015年二月17日 20:43 UTC](https://meta.discourse.org/t/download-link-content-disposition-file-save-prompt/25228/7 "2015-02-17T20:43:46Z")

</div>

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: [Live restarts of a supervised unicorn process - #5 by adamflanagan - ruby - Sam Saffron's Blog](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](http://discuss.samsaffron.com/uploads/default/76/f8b48c825c151f19.png)

###Post 2 (does work as expected)  
Post: [Announcing rubybench.org - ruby - Sam Saffron's Blog](http://discuss.samsaffron.com/t/announcing-rubybench-org/199)  
Download link: [http://discuss.samsaffron.com/uploads/default/2090e0e885edd6bd40f33e3a8ed0567dfac391e6](http://discuss.samsaffron.com/uploads/default/2090e0e885edd6bd40f33e3a8ed0567dfac391e6)

###Post 3 (doesn’t work)  
Post: [Call to Action: Long running Ruby benchmark - ruby - Sam Saffron's Blog](http://discuss.samsaffron.com/t/call-to-action-long-running-ruby-benchmark/83)  
Download link: [http://discuss.samsaffron.com/uploads/default/84/493197bf05a35c45.png](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  
 ![](https://global.discourse-cdn.com/meta/original/3X/d/9/d9988c49657be1d3ade114885f695a1aa25f71ef.gif)

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2015年二月17日 20:57 UTC](https://meta.discourse.org/t/download-link-content-disposition-file-save-prompt/25228/8 "2015-02-17T20:57:19Z")

</div>

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//cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/original/3X/d/9/d9988c49657be1d3ade114885f695a1aa25f71ef.gif`

---

<div class="post-metadata">

**Author:** ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)\
**Post date:** [2015年二月17日 21:22 UTC](https://meta.discourse.org/t/download-link-content-disposition-file-save-prompt/25228/9 "2015-02-17T21:22:48Z")

</div>

> [@sam](#):
>
> Rails Engine being mounted

> [@sam](#):
>
> tagger is mounting an engine

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:  
 ![](https://global.discourse-cdn.com/meta/original/3X/2/1/211135f30a84617e019457eb55a6c17ee5e06bed.png)

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2015年二月17日 21:30 UTC](https://meta.discourse.org/t/download-link-content-disposition-file-save-prompt/25228/10 "2015-02-17T21:30:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)\
**Post date:** [2015年二月17日 21:33 UTC](https://meta.discourse.org/t/download-link-content-disposition-file-save-prompt/25228/11 "2015-02-17T21:33:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2015年二月17日 21:37 UTC](https://meta.discourse.org/t/download-link-content-disposition-file-save-prompt/25228/12 "2015-02-17T21:37:43Z")

</div>

np, I think we have a repro anyway

---

<div class="post-metadata">

**Author:** ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)\
**Post date:** [2015年二月17日 21:53 UTC](https://meta.discourse.org/t/download-link-content-disposition-file-save-prompt/25228/13 "2015-02-17T21:53:42Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)\
**Post date:** [2015年二月17日 22:25 UTC](https://meta.discourse.org/t/download-link-content-disposition-file-save-prompt/25228/14 "2015-02-17T22:25:34Z")

</div>

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):  
[https://github.com/discourse/discourse/commit/31e9cafe0e053d04fce249a4059bc27ed0772c03](https://github.com/discourse/discourse/commit/31e9cafe0e053d04fce249a4059bc27ed0772c03)

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.

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2015年二月17日 22:31 UTC](https://meta.discourse.org/t/download-link-content-disposition-file-save-prompt/25228/15 "2015-02-17T22:31:24Z")

</div>


