By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,084 Members | 1,207 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,084 IT Pros & Developers. It's quick & easy.

Content-Disposition: "inline" vs. "extension-token"

P: n/a
Please redirect me if this message is posted to the wrong group.

Given the intention of delivering content to an HTTP user agent (such
as Internet Explorer) which is to be immediately opened by an
associated application, there are the Content-Disposition type options
of "inline" or "extension-token". Specifically as regards Internet
Explorer, I've tried both inline and the specific filename extension
(xls,csv,pdf,doc,...) and the browser handling is the same for both
types: the browser opens the associated application. For other
extensions (zip,ppt,...) where the browser is unable or unwilling to
directly open an associated application, it issues a Save-As-or-Open
dialog.

I've also tested the above with Firefox and see the same behavior:
both "inline" and "extension-token" are handled the same way.

Can anyone advise whether or not there would be any situations where a
difference would be seen in the UA behavior, with respect to using
"inline" versus the specific extension?

Thanks in advance.

-Dave H.

Jun 20 '07 #1
Share this Question
Share on Google+
12 Replies


P: n/a
On Wed, 20 Jun 2007, Dave H. wrote:
Please redirect me if this message is posted to the wrong group.
Perhaps
<news:comp.infosystems.www.browsers.ms-windows>
<news:comp.infosystems.www.servers.ms-windows>
<news:comp.infosystems.www.servers.unix>
Given the intention of delivering content to an HTTP user agent (such
as Internet Explorer) which is to be immediately opened by an
associated application,
You should rather leave this decision to the reader, i.e. open
in browser or open in another program.
Specifically as regards Internet
Explorer, I've tried both inline and the specific filename extension
(xls,csv,pdf,doc,...)
There are no "filename extensions" on the web. There is only
"Content-Type".

--
In memoriam Alan J. Flavell
http://groups.google.com/groups/sear...Alan.J.Flavell
Jun 21 '07 #2

P: n/a
On Jun 21, 4:49 am, Andreas Prilop <AndreasPrilop2...@trashmail.net>
wrote:
On Wed, 20 Jun 2007, Dave H. wrote:
Please redirect me if this message is posted to the wrong group.

Perhaps
<news:comp.infosystems.www.browsers.ms-windows>
<news:comp.infosystems.www.servers.ms-windows>
<news:comp.infosystems.www.servers.unix>
Thanks.
Given the intention of delivering content to an HTTP user agent (such
as Internet Explorer) which is to be immediately opened by an
associated application,

You should rather leave this decision to the reader, i.e. open
in browser or open in another program.
Assuming that by "reader" you mean the user of the UA, then I probably
should have specified that my post concerns an intranet web
application which provides both a download and an open button, and the
question regards how the CGI behind the open button structures its
HTTP headers. The application is required to store data in encrypted
format and not use any temporary files to decrypt data for web
availability; therefore it must deliver data inline directly from the
standard output of openssl.
Specifically as regards Internet
Explorer, I've tried both inline and the specific filename extension
(xls,csv,pdf,doc,...)

There are no "filename extensions" on the web. There is only
"Content-Type".
I am referring to "extension-token" as described by RFC 2183 which
governs the Content-Disposition header. Granted it was written with
email attachments in mind; however, unless I am mistaken, use of the
Content-Disposition header in HTTP also conforms to this standard.

--
In memoriam Alan J. Flavellhttp://groups.google.com/groups/search?q=author:Alan.J.Flavell
-Dave H.

Jun 21 '07 #3

P: n/a
Scripsit Dave H.:
I probably
should have specified that my post concerns an intranet web
application
Indeed. Now your question was thus off-topic without even revealing it.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/
Jun 21 '07 #4

P: n/a
On Jun 21, 4:28 pm, "Jukka K. Korpela" <jkorp...@cs.tut.fiwrote:
Scripsit Dave H.:
I probably
should have specified that my post concerns an intranet web
application

Indeed. Now your question was thus off-topic without even revealing it.
Which was why my first statement was "Please redirect me if this
message is posted to the wrong group".

However, I am curious to find out why you consider a question about an
intranet web application to be off-topic in this group, but when the
exact environment was unknown the post was apparently more suitable.
--
Jukka K. Korpela ("Yucca")http://www.cs.tut.fi/~jkorpela/
-Dave H.

Jun 21 '07 #5

P: n/a
On Wed, 20 Jun 2007 16:50:59 -0000, "Dave H." <dh****@gmail.com>
wrote:
>Can anyone advise whether or not there would be any situations where a
difference would be seen in the UA behavior, with respect to using
"inline" versus the specific extension?
When the RFC cites "extension-token" it means "some other value that
extends this definition". It defines "inline" as the only official
value for Content-Disposition.

In practice there is also the value "attachment", which suggests to
the UA that it should do some sort of "Save As" instead of attempting
to display the item directly.

This works in Internet Explorer and in Firefox. Suggesting the
filename to "Save As", though, doesn't work in Internet Explorer. IE
uses whatever filename is served, which can get annoying very quickly
when you have a CGI script doing the serving.

Suggest a filename via
Content-Disposition: attachment; filename=file.ext

If anyone knows how to get IE to recognize the suggested filename,
please share with the class. It's been irritating me since IE5.
Jun 22 '07 #6

P: n/a
Scripsit Dave H.:
>Indeed. Now your question was thus off-topic without even revealing
it.

Which was why my first statement was "Please redirect me if this
message is posted to the wrong group".
That was a wrong question. _You_ are supposed to decide on the group before
posting. It's just rude to jump into a public forum on (say) cats and ask a
question about (say) cows and add a request like that, especially when the
forum is rather crowded.
However, I am curious to find out why you consider a question about an
intranet web application to be off-topic in this group, but when the
exact environment was unknown the post was apparently more suitable.
You had your chance of being treated just as ignorant, but you seem to wish
to turn that into bad reputation. I'm afraid your plonk rate is going up
fast.

Any question here is treated as WWW related until proven otherwise. Anyone
should understand this from the group name. It often happens that people ask
here something, get an answer that is fairly correct in WWW terms (e.g.,
"you can't"), then start explaining that they won't take that as an answer,
_because_ they have an intranet bla bla bla.

If you get the hint, you might stop now, and maybe we might have something
to discuss about HTML authoring for the WWW in future.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Jun 22 '07 #7

P: n/a
On Jun 22, 6:24 am, "Jukka K. Korpela" <jkorp...@cs.tut.fiwrote:
Scripsit Dave H.:
Indeed. Now your question was thus off-topic without even revealing
it.
Which was why my first statement was "Please redirect me if this
message is posted to the wrong group".

That was a wrong question. _You_ are supposed to decide on the group before
posting. It's just rude to jump into a public forum on (say) cats and ask a
question about (say) cows and add a request like that, especially when the
forum is rather crowded.
However, I am curious to find out why you consider a question about an
intranet web application to be off-topic in this group, but when the
exact environment was unknown the post was apparently more suitable.

You had your chance of being treated just as ignorant, but you seem to wish
to turn that into bad reputation. I'm afraid your plonk rate is going up
fast.

Any question here is treated as WWW related until proven otherwise. Anyone
should understand this from the group name. It often happens that people ask
here something, get an answer that is fairly correct in WWW terms (e.g.,
"you can't"), then start explaining that they won't take that as an answer,
_because_ they have an intranet bla bla bla.

If you get the hint, you might stop now, and maybe we might have something
to discuss about HTML authoring for the WWW in future.

--
Jukka K. Korpela ("Yucca")http://www.cs.tut.fi/~jkorpela/

Jukka, after having scanned back a few weeks worth of posts here, it
now becomes clear why you are at times considered to be a boorish know-
it-all and one of the self-anointed newsgroup purity police. I've
been reading Usenet for close to 20 years and have seen a great many
highly intelligent people (most CS profs or PHDs, as you probably are)
manage to interact with people they perceive to be of lesser
intelligence in a respectful manner. Likewise, I've seen a
(thankfully lesser) number of self-impressed blowhards who seem to
feel the only way to deal with those below their IQ range and
technical capability is with disdain and impatience. Clearly, the
later group has emotional issues that seem to come to the fore when
they feel their time has been wasted by some lesser being. Sad.

As for the specific issues you commented on, I'll just say that I
chose this group because among those groups which had prior posts
relating to my questions, this was the only one with a significant
number of subscribers and fairly recent traffic. As for the WWW
versus Intranet bullsh*t, that's clearly just you being you. Whether
on the public Internet or a private Intranet, the same server
equipment runs the same software, which use the same rule sets and
protocols to deliver the same content which is composed of the same
coding structures. Just because one is inside a firewall and one
outside doesn't mean a thing in discussion of HTML authoring. And if
you weren't so in need of proving what a dolt I am, you would probably
not even give it a second thought.

-Dave H.

Jun 22 '07 #8

P: n/a
Dave H. wrote:
Jukka, after having scanned back a few weeks worth of posts here, it
now becomes clear why you are at times considered to be a boorish know-
it-all and one of the self-anointed newsgroup purity police.
Isn't "troll" a Finnish curiosity? :-]

I have similar problems like you, not knowing in which group I could
find answers to my problems at all. If everybody only would respond "OT
here!", one never has a chance to get an answer. But fortunately other
people (the majority, I think) will also give constructive advice on OT
topics, if ever possible.

Jukka is one of the typical newgsgroup backbones, with excellent
technical knowledge, at the cost of personal problems. Don't try to
argue, or you'll make them even more angry and aggressive. Sometimes I
feel a need for an target specifier: newsgroup XYZ except ... ;-)

DoDi
Jun 23 '07 #9

P: n/a
On Jun 21, 10:01 pm, Richard Rudie <rsqua...@dont.spam.mewrote:
On Wed, 20 Jun 2007 16:50:59 -0000, "Dave H." <dh1...@gmail.com>
wrote:

In practice there is also the value "attachment", which suggests to
the UA that it should do some sort of "Save As" instead of attempting
to display the item directly.

This works in Internet Explorer and in Firefox. Suggesting the
filename to "Save As", though, doesn't work in Internet Explorer. IE
uses whatever filename is served, which can get annoying very quickly
when you have a CGI script doing the serving.

Suggest a filename via
Content-Disposition: attachment; filename=file.ext

If anyone knows how to get IE to recognize the suggested filename,
please share with the class. It's been irritating me since IE5.
Interesting ... I find the exact reverse to be the case, at least with
IE7 and Firefox 2. When provided with a "filename" parameter, it is
IE that accepts and uses the suggested name to seed the Save As name
field. It is Firefox that ignores the suggested name and uses the
name of the CGI script which served the content.

Given a CGI script "doc_decrypt.cgi" which emits the contents of an MS-
Word document preceded by the headers shown below; IE will seed the
Save As name field with "74.1.doc" and Firefox will seed the field
with "doc_decrypt.cgi":

Content-Type: application/download
Content-Disposition: attachment; filename="74.1.doc"; modification-
date="11 Jun 2007 17:50:01 +0000"
Last-Modified: Mon, 11 Jun 2007 17:50:01 GMT

-Dave H.

Jun 23 '07 #10

P: n/a
On Jun 22, 9:32 pm, Hans-Peter Diettrich <DrDiettri...@aol.comwrote:
>
Jukka is one of the typical newgsgroup backbones, with excellent
technical knowledge, at the cost of personal problems. Don't try to
argue, or you'll make them even more angry and aggressive. Sometimes I
feel a need for an target specifier: newsgroup XYZ except ... ;-)

DoDi
Sage advice, clearly to be ignored at ones own peril. Thanks :)

Jun 23 '07 #11

P: n/a
On Sat, 23 Jun 2007 , "Dave H." <dh****@gmail.comwrote:
Interesting ... I find the exact reverse to be the case, at least with
IE7 and Firefox 2. When provided with a "filename" parameter, it is
IE that accepts and uses the suggested name to seed the Save As name
field. It is Firefox that ignores the suggested name and uses the
name of the CGI script which served the content.
I did some further Googling a few minutes ago and found out IE's deal.
Apparently Microsoft finally got around to fixing the
Content-Disposition bug in IE7. (It was a known issue back to IE4; see
http://support.microsoft.com/kb/279667 for an example.) But! If you
serve with "Cache-Control: no-cache" (maybe "Pragma: no-cache" as
well?), IE ignores the suggested filename. I found this tidbit in
somebody's blog, http://tinyurl.com/2nmwn4

I have a CGI script generating an image on the fly, and IE always
wanted to save it as "untitled.bmp" even though it was 1) given a
suggested filename and 2) a JPEG! I took out the no-cache headers and
it's working fine now.

Firefox 2, in my experience, uses the suggested filename either way,
so I don't know what to say about that.
But regards yout original post: you were serving as (for example)

Content-Disposition: zip; filename="archive.zip"

? Changing it to

Content-Disposition: attachment; filename="archive.zip"

should do what you want it to do.
Jun 23 '07 #12

P: n/a
On Jun 23, 4:40 am, Richard Rudie <rsqua...@dont.spam.mewrote:
On Sat, 23 Jun 2007 , "Dave H." <dh1...@gmail.comwrote:
Interesting ... I find the exact reverse to be the case, at least with
IE7 and Firefox 2. When provided with a "filename" parameter, it is
IE that accepts and uses the suggested name to seed the Save As name
field. It is Firefox that ignores the suggested name and uses the
name of the CGI script which served the content.
[...]

Firefox 2, in my experience, uses the suggested filename either way,
so I don't know what to say about that.
You are right and I apologize -- I realized afterward that I was
describing how IE7 and Firefox 2 handle right-click/Save As, not how
they handle a CGI delivering a "Content-Disposition: attachment"
header.

-Dave H.

Jun 25 '07 #13

This discussion thread is closed

Replies have been disabled for this discussion.