473,387 Members | 1,481 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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
12 11496
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
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
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
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
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: kevin | last post by:
Hi, Any help with this would be really appreciated! I'm trying to download a file from a remote server. The access permissions is okay but the problem I'm facing is that the file is getting...
2
by: Jeff G. | last post by:
Hello everyone, I have read through the newsgroups (thank God for 'em!) extensively looking for an example of how to pass a file (PDF) from a webresponse stream down to a web client. Here's the...
2
by: spammy | last post by:
Hi all, I'm trying to create a text file on the fly for a user of an ASP.NET application to download. So far the code I have is: MemoryStream oStream = null; // using System.IO string...
3
by: mpraneetha | last post by:
Hello Everyone, i am creating a compostie control (for web)...which would contain a button "GenerateFile" on click of that button..i should generate a file (which is not a problem) and also send...
1
by: theWizard1 | last post by:
The following sends my email, but the attachment is empty. The attachment should contain the data that is in the string that was created from the xmlReader. I have a stored procedure written...
3
by: TomislaW | last post by:
I am sending word document with e-mail from asp.net 2.0 application. I read doc file like this:FileStream fs = System.IO.File.Open(docPath,FileMode.Open,FileAccess.Read,FileShare.Read); Then...
8
by: kcovert | last post by:
using System.Net.Mail; I've been unable to get a carriage return/line feed into the body of my Outlook message. Have look all over the web for a soltion with no luck. Here's what I have tried...
3
by: narinder2 | last post by:
I have an Access database (images.mdb) that has 2 columns: one is the id of the picture (an integer) and one (column named picture) is a field of type OLE Object which contains an image stored as...
11
by: Ed Bitzer | last post by:
I have been able using the namespace System.Web.Mail and its method Smtp.mail.send to mail simple text messages to a small group within our 55 and older community. I need help expanding the...
6
by: Chocolade | last post by:
Hi, Im using System.Net.Mail to send email in my application it was working great without any problems untill this morning after like 20-30 tries it was sending the email ok then suddenly this...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.