Hi,

I needed to be able to force content:disposition as inline for a recent project.

It's a pretty short patch which lets you pass ?download=0 on the query string to force a link to open inline.

Any chance of getting this into the module?

CommentFileSizeAuthor
allow-passing-inline-disposition.patch681 bytessamhassell

Comments

samhassell’s picture

Status: Active » Needs review

patch attached.

arski’s picture

hmm, what would this do, would this force the browser to open the file inside the window instead of downloading it? Does this override the default browser settings. I'm asking because if it doesn't then this sounds equivalent to the default behaviour without the module.

samhassell’s picture

Yep it would force the browser to open the file in the browser.

It seems to override the browser settings, at least in Chrome.

My implementation is in a modal popup offering the user to either download or open in place a file. Without being able to set inline, Chrome is downloading from both links.

Its a valid header according to the RFC at http://www.ietf.org/rfc/rfc2183.txt

    disposition-type := "inline"
                       / "attachment"
                       / extension-token
                       ; values are not case-sensitive
arski’s picture

Status: Needs review » Needs work

Hm, well, I don't see any harm in introducing this to the module. However, if that were to happen, then basically all the formatters should be duplicated with the inline version (which could use download=0) for example. I don't want to set the disposition header to "inline" by default, because that would mean that enabling this module alone will mess with the default Drupal settings, which is not something I would want to happen.

Technically this is easy, my only concern is that duplicating all the formatters in CCK field displays and Views might result in overly long selection list and thus have an averse impact on usability.. hmm

arski’s picture

Status: Needs work » Patch (to be ported)

OK, so basically I just adopted your patch.. don't really see the need for inline formatters throughout, unless someone explicitly requests them.. So just use download=0 to force inline disposition. (new release coming up soon, in dev for now)

arski’s picture

Status: Patch (to be ported) » Fixed

wops

samhassell’s picture

much appreciated :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.