473,396 Members | 1,749 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,396 software developers and data experts.

Response.AddHeader "Content-Disposition": Does this even work in with MS?

In the following file below, I want it to return itself as a Rich Text
Format file that populates the variables with data from the database.

I set up the mime types and the filename accordingly.

Now, when I call this page on a Linux system, using the Mozilla browser,
it opens a dialog, asks me whether I want to save it or open it, and if
I open it, opens it as test.rtf, just like I tell it to in the
Content-Disposition header.

However, if I use a MS System with an MSIE browser, I just get an error
that it can't open the page.

Any help on WHY would be appreciated. (And what I can do to get MS
systems to understand.)
[begin page]

<!-- #include file="../assets/includes/datasource.asp" -->
<%
Response.ContentType="application/rtf"
Response.AddHeader "Content-Disposition", "attachment;filename=test.rtf"

Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open sDataSource

sqlText = "SELECT id,name,phonenumber FROM tblTest"

set Res = oConn.Execute(sqlText)

%>{\rtf1\ansi\deff0\adeflang1025
{\fonttbl{\f0\froman\fprq2\fcharset0 Nimbus Roman No9 L;}{\f1\froman\fprq2\fcharset0 Nimbus Roman No9 L;}{\f2\fnil\fprq2\fcharset0 Kochi Mincho;}{\f3\fnil\fprq0\fcharset2 Times New Roman;}{\f4\fnil\fprq2\fcharset0 KacstBook;}}
{\colortbl;\red0\green0\blue0;\red128\green128\blu e128;}
{\stylesheet{\s1{\*\hyphen2\hyphlead2\hyphtrail2\h yphmax0}\rtlch\afs24\lang255\ltrch\dbch\af2\afs24\ langfe255\loch\f0\fs24\lang1033\snext1 Default;}
{\s2\sa283{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax 0}\rtlch\afs24\lang255\ltrch\dbch\af2\afs24\langfe 255\loch\f0\fs24\lang1033\sbasedon1\snext2 Text body;}
}
{\info{\comment StarWriter}{\vern6410}}\deftab1250
{\*\pgdsctbl
{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\margl sxn1800\margrsxn1800\margtsxn1440\margbsxn1440\pgd scnxt0 Default;}}
\paperh15840\paperw12240\margl1800\margr1800\margt 1440\margb1440\sectd\sbknone\pgwsxn12240\pghsxn158 40\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn 1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aft nrstcont\aftnstart1\aftnnrlc
\pard\plain \s1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlc h\afs24\lang255\ltrch\dbch\af2\afs24\langfe255\loc h\f0\fs24\lang1033\sa283\ltrch\loch\f3\fs20 {\ltrch\loch\f3 <%=Res("name") %> President Pervez Musharraf says government forces believe they have surrounded "a high-valued target" during a new offensive in the tribal region near the Afghan border.}
\par \pard\plain \s2\sa283{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0 }\rtlch\afs24\lang255\ltrch\dbch\af2\afs24\langfe2 55\loch\f0\fs24\lang1033\ltrch\loch\f3\fs20 {\ltrch\loch\f3 Senior Pakistani officials, speaking on condition of anonymity, later told reporters they believe their troops may have cornered al-Qaida's number two leader - Ayman al-Zawahiri. }
\par {\ltrch\loch\f3 Mr. Musharraf said in a pre-recorded interview for CNN Thursday, that a high valued target could be among the militants because of the stiff resistance being put up by those fighting government troops.}
\par {\ltrch\loch\f3 The U.S. Defense Department says it has no information on who the high value target may be.}
\par {\ltrch\loch\f3 The reports of the standoff come as hundreds of Pakistani army troops and paramilitary forces -- backed by helicopter gunships and artillery -- have moved into South Waziristan. }
\par {\ltrch\loch\f3 The new offensive follows fierce battles in the region Tuesday that killed 15 paramilitary troops and 24 gunmen, including several foreign fighters believed to by of Middle East and Chechen origin. Pakistani authorities say they have detained about 18 susp
ects.}
\par {\ltrch\loch\f3 It coincides with a continuing major operation by U.S.-led troops in Afghanistan, aimed at hunting down al-Qaida and Taleban fighters and ultimately finding Osama bin Laden, who is believed to be hiding along the border. }
\par \pard\plain \s1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlc h\afs24\lang255\ltrch\dbch\af2\afs24\langfe255\loc h\f0\fs24\lang1033
\par }

[end page]

--
[ Sugapablo ]
[ http://www.sugapablo.com <--music ]
[ http://www.sugapablo.net <--personal ]
[ su*******@12jabber.com <--jabber IM ]
Jul 19 '05 #1
1 3925
No idea why, but it SHOULD work, since I have used this "trick" for a long
time. You could use the page with some random ID in the URL each time, just
so the browser does not look for it in the cache. E.g.

MyPage.asp?ID=RANDOMID

--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com
"Sugapablo" <ru********@sugapablo.com> wrote in message
news:sl***********************@dell.sugapablo.net. ..
In the following file below, I want it to return itself as a Rich Text
Format file that populates the variables with data from the database.

I set up the mime types and the filename accordingly.

Now, when I call this page on a Linux system, using the Mozilla browser,
it opens a dialog, asks me whether I want to save it or open it, and if
I open it, opens it as test.rtf, just like I tell it to in the
Content-Disposition header.

However, if I use a MS System with an MSIE browser, I just get an error
that it can't open the page.

Any help on WHY would be appreciated. (And what I can do to get MS
systems to understand.)
[begin page]

<!-- #include file="../assets/includes/datasource.asp" -->
<%
Response.ContentType="application/rtf"
Response.AddHeader "Content-Disposition", "attachment;filename=test.rtf"

Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open sDataSource

sqlText = "SELECT id,name,phonenumber FROM tblTest"

set Res = oConn.Execute(sqlText)

%>{\rtf1\ansi\deff0\adeflang1025
{\fonttbl{\f0\froman\fprq2\fcharset0 Nimbus Roman No9 L;}{\f1\froman\fprq2\fcharset0 Nimbus Roman No9 L;}{\f2\fnil\fprq2\fcharset0
Kochi Mincho;}{\f3\fnil\fprq0\fcharset2 Times New
Roman;}{\f4\fnil\fprq2\fcharset0 KacstBook;}} {\colortbl;\red0\green0\blue0;\red128\green128\blu e128;}
{\stylesheet{\s1{\*\hyphen2\hyphlead2\hyphtrail2\h yphmax0}\rtlch\afs24\lang2
55\ltrch\dbch\af2\afs24\langfe255\loch\f0\fs24\lan g1033\snext1 Default;} {\s2\sa283{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax 0}\rtlch\afs24\lang255\ltr
ch\dbch\af2\afs24\langfe255\loch\f0\fs24\lang1033\ sbasedon1\snext2 Text
body;} }
{\info{\comment StarWriter}{\vern6410}}\deftab1250
{\*\pgdsctbl
{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\margl sxn1800\margrsxn1800\margt
sxn1440\margbsxn1440\pgdscnxt0 Default;}} \paperh15840\paperw12240\margl1800\margr1800\margt 1440\margb1440\sectd\sbkno
ne\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn18 00\margtsxn1440\margbsxn14
40\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnr stcont\aftnstart1\aftnnrlc \pard\plain \s1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlc h\afs24\lang255\ltrch\dbch
\af2\afs24\langfe255\loch\f0\fs24\lang1033\sa283\l trch\loch\f3\fs20
{\ltrch\loch\f3 <%=Res("name") %> President Pervez Musharraf says government
forces believe they have surrounded "a high-valued target" during a new
offensive in the tribal region near the Afghan border.} \par \pard\plain \s2\sa283{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0 }\rtlch\afs24\lang255\ltrc
h\dbch\af2\afs24\langfe255\loch\f0\fs24\lang1033\l trch\loch\f3\fs20
{\ltrch\loch\f3 Senior Pakistani officials, speaking on condition of
anonymity, later told reporters they believe their troops may have cornered
al-Qaida's number two leader - Ayman al-Zawahiri. } \par {\ltrch\loch\f3 Mr. Musharraf said in a pre-recorded interview for CNN Thursday, that a high valued target could be among the militants because
of the stiff resistance being put up by those fighting government troops.} \par {\ltrch\loch\f3 The U.S. Defense Department says it has no information on who the high value target may be.} \par {\ltrch\loch\f3 The reports of the standoff come as hundreds of Pakistani army troops and paramilitary forces -- backed by helicopter
gunships and artillery -- have moved into South Waziristan. } \par {\ltrch\loch\f3 The new offensive follows fierce battles in the region Tuesday that killed 15 paramilitary troops and 24 gunmen, including
several foreign fighters believed to by of Middle East and Chechen origin.
Pakistani authorities say they have detained about 18 susp ects.}
\par {\ltrch\loch\f3 It coincides with a continuing major operation by U.S.-led troops in Afghanistan, aimed at hunting down al-Qaida and Taleban
fighters and ultimately finding Osama bin Laden, who is believed to be
hiding along the border. } \par \pard\plain \s1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlc h\afs24\lang255\ltrch\dbch
\af2\afs24\langfe255\loch\f0\fs24\lang1033 \par }

[end page]

--
[ Sugapablo ]
[ http://www.sugapablo.com <--music ]
[ http://www.sugapablo.net <--personal ]
[ su*******@12jabber.com <--jabber IM ]

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Patrick | last post by:
hi several general webpages (more or less static, e.g. errorpage, timeoutpage etc.) i need in all kind of asp.net-applications. instead of copy this pages (the *.aspx or *.html) into every...
1
by: Soheil | last post by:
I use webservice to connect to a server on Internet and sometimes(not always), I recieve this error on calling webserice member functions. Error: ********************************** Client found...
0
by: daryl | last post by:
I have a situation where a webservice has worked fine in a development environment, but when placed into production has stopped working (although at one time it was). Using WSE 2.0/DIME, we...
0
by: Robert Rotstein | last post by:
I have a simple web service which operates correctly. But when I try to add a SoapExtension, it always throws an exception: System.InvalidOperationException: Client found response content type...
1
by: Mark P | last post by:
I've written a .Net 1.1 Web Service that receives a file and forwards the file to another Web Service (this one written in Java). The Web Service generally works, but intermittently gets the...
0
by: Mark P | last post by:
I've written a .Net 1.1 Web Service that receives a file and forwards the file to another Web Service (this one written in Java). The Web Service generally works, but intermittently gets the...
13
by: =?Utf-8?B?S2VzdGZpZWxk?= | last post by:
Hi Our company has a .Net web service that, when called via asp.net web pages across our network works 100%! The problem is that when we try and call the web service from a remote machine, one...
3
by: Alexander Smirnov | last post by:
I'm developing asp.net 2 web application and need to make a custom http handler which sometime must send response with "204 No Content" code. I set HttpResponse.Status="204 No Content"; But asp...
7
xNephilimx
by: xNephilimx | last post by:
lHi guys! I'm having a little problem that's getting on my nerves, I couldn't find a solution, I also tryed googling it and I found nothing... (my field of expertise is in AS 2 and 3, but I still...
4
by: sbettadpur | last post by:
Hi All, I am getting the following Error while connecting to the SQL reports using report viewer .I have given the path like: ...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.