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

Response.AddHeader("Content-Disposition"....

I've this statement in my output's creation:

Response.Clear()

Response.ContentType = "application/vnd.google-earth.kml+xml kml"

Response.AddHeader("Content-Disposition", "inline; filename=Log_" &
activityLogID & ".kml")

The strage is that on my development server all works (IE try to open the
file with GE, and if I force it to save the file when I click on the link,
it prompts for "Log_....." file name). But on production server, IE doesn't
recognize MIME type, and if I force it to save the file, it prompts for the
original aspx's file name.
Firefox works well on all two servers. Where is the error?

thanks

Sep 7 '06 #1
11 15044
"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:ha*************@TK2MSFTNGXA01.phx.gbl...
Hello Trapulo,

From your description, you're using ASP.NET page to flush out some google
earth map file and let the client-side choose the google earth, however,
you found this works when running the application on development server
but
not work when running on a production server ,correct?
yes
As for the different behavior, are you getting them on the same client
machine when visiting the server page or just test locally on each server?
I would recommend you try different remote client machine to see whether
you'll get different behavior.
I try from the same machine, that is also the development server. I've also
tried from other machines, but only calling the production server, and I
have the same behavior.
Based on my experience, the client-side browser's behavior against
handling
different mime-type is depend on its internal implementation. For IE, you
can have a look at the following msdn article:

#MIME Type Detection in Internet Explorer
http://msdn.microsoft.com/workshop/n.../appendix_a.as
p?frame=true
I think the problem can be here:
"If a positive match is found (one of the hard-coded tests succeeded), this
MIME type is immediately returned as the final determination, overriding the
server-provided MIME type (this type of behavior is necessary to identify a
..gif file being sent as text/html). During scanning, it is determined if the
buffer is predominantly text or binary."

maybe IE scan content, and see that it is an xml file. So it shows it as
xml, ignoring mime directive. If this can explain the problem (and then I
don't know how to solve it because this is xml, but IE may open with right
viewer), this doesn't explain why calling the page on the production server
works.
And if the problem is specific to server, you can check the registered
mime-type in IIS 6's service manager(see my attached screenshot in this
message). You need to select the topest(machine) node in IIS manager and
right click to choose "properties" menu.
Yes, I know this. But if I am generating the kml format from aspx, I think
that MIME types are unuseful, aren't them? In fact, either on my development
server I cannot find a setting related to this format. The only difference
between two servers is that the development one has google earth installed,
but I think it's strange it can change IIS behavor..
and as for the filename problem, what's the behevior if you choose the
code
as below:

========================
Response.ClearHeaders();
Response.ClearContent();

Response.ContentType = "application/vnd.google-earth.kml+xml kml"

Response.AddHeader("Content-Disposition", "attachment; filename=Log_" &
activityLogID & ".kml")

===================

this will always prompt for file open or save.
I try this, however my requirenment is to open direct the file and not to
save it. However, it can be an acceptable tradeoff if this can work with IE
also, and not with firefox.

thanks

Sep 8 '06 #2
Thanks for your reply Trapulo,

If you get the different results on the same client machie against
differetn target server. It is still likely the response stream contains
different content/headers. As for those IIS server mime-type setting,
they're actually read from the server machine's registry. Also, you
mentioned that the difference between the two servers is that development
server has google earch installed while the deployment machine not, you can
check whether the mime-type lists on the two machines also vary.

For general testing, I think you can try put a static kml file in IIS
virual diretory and use browser to navigate to it to see how the client
browser process it. You can also use some network trace tools to capture
the http response stream of the two different response(correct and
incorrect) to see what's the difference in the raw response.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Sep 11 '06 #3

"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:4R**************@TK2MSFTNGXA01.phx.gbl...
Thanks for your reply Trapulo,

If you get the different results on the same client machie against
differetn target server. It is still likely the response stream contains
different content/headers. As for those IIS server mime-type setting,
they're actually read from the server machine's registry. Also, you
mentioned that the difference between the two servers is that development
server has google earch installed while the deployment machine not, you
can
check whether the mime-type lists on the two machines also vary.
I tried to find some specific settings on my development server, but it
seems that GE has not defined any setting (and, in fact, it seems
reasonable: it's very strange that it can update IIS settings..).
For general testing, I think you can try put a static kml file in IIS
virual diretory and use browser to navigate to it to see how the client
browser process it.
how can this work? If the two servers haven't any kml related mime setting,
IIS cannot stream any header..

You can also use some network trace tools to capture
the http response stream of the two different response(correct and
incorrect) to see what's the difference in the raw response.
Can you suggest any simple tool I can use? I haven't it and I don't know
what can I use

However, I've checked that with "attachment" instead of "inline" in
content.disposition (as you suggested), IE starts google earth and shows the
file if I select "open" when it asks if open or save the file. It's a
workaround and it's not the real solution, but it's still a step away.

thanks
Sep 13 '06 #4
Thanks for your reply Trapulo,

For your questions in the last reply:
I tried to find some specific settings on my development server, but it
seems that GE has not defined any setting (and, in fact, it seems
reasonable: it's very strange that it can update IIS settings..).
==================================
Yes, I agree that GE won't add any particular settings on the server.
However, I think it may register the mine-type in registery(whch will
display in the mime type list). Is this the difference between the two
servers?

how can this work? If the two servers haven't any kml related mime setting,
IIS cannot stream any header..
========================================
due to my limit experience with IIS, I can not gurantee the exact behavior.
However, the mime-type list you see in the IIS management console's root
node will affect the response content if the document extension is matching
one of the mime-type.

Can you suggest any simple tool I can use? I haven't it and I don't know
what can I use
=======================================
I usually use the trace utility in Soap Toolkit 3.0 to capture http
request/response messages, you can find it in the following location:

#SOAP Toolkit 3.0
http://www.microsoft.com/downloads/d...0DD-CEEC-4088-
9753-86F052EC8450&displaylang=en

Many guys like using Fiddler to debug IE or related issue, it can also
capture http messages process by IE:

#Http Debugging with Fiddler
http://blogs.msdn.com/ie/archive/2005/01/28/362511.aspx

Hope this helps also.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Sep 15 '06 #5

"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:dQ****************@TK2MSFTNGXA01.phx.gbl...
Thanks for your reply Trapulo,

For your questions in the last reply:

I tried to find some specific settings on my development server, but it
seems that GE has not defined any setting (and, in fact, it seems
reasonable: it's very strange that it can update IIS settings..).
==================================
Yes, I agree that GE won't add any particular settings on the server.
However, I think it may register the mine-type in registery(whch will
display in the mime type list). Is this the difference between the two
servers?
I cannot find any difference. However, I also know that if I override with
response.ContentType the default mime type from aspx, IIS will stream data
with my mime type, and it will not use registry settings..
how can this work? If the two servers haven't any kml related mime
setting,
IIS cannot stream any header..
========================================
due to my limit experience with IIS, I can not gurantee the exact
behavior.
However, the mime-type list you see in the IIS management console's root
node will affect the response content if the document extension is
matching
one of the mime-type.
yes. But I'm streaming data from an aspx file, so IIS cannot work with
extension to set kml mime type. It uses aspx extension to start ASP.NET, the
I can set the mime streamed to the client..
Can you suggest any simple tool I can use? I haven't it and I don't know
what can I use
=======================================
I usually use the trace utility in Soap Toolkit 3.0 to capture http
request/response messages, you can find it in the following location:
I find this tool that is very simple and quick to use:
http://www.initworld.com/mozdev/livehttpheaders

Results:

This is from production server:
HTTP/1.x 200 OK
Cache-Control: private
Date: Fri, 15 Sep 2006 09:32:42 GMT
Content-Type: application/vnd.google-earth.kml+xml kml; charset=utf-8
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
content-disposition: attachment; filename=Localizzazione.kml
Content-Encoding: gzip
Vary: Accept-Encoding
Transfer-Encoding: chunked

This is from my dev envonment:
HTTP/1.x 200 OK
Server: ASP.NET Development Server/8.0.0.0
Date: Fri, 15 Sep 2006 09:35:36 GMT
X-AspNet-Version: 2.0.50727
content-disposition: attachment; filename=Localizzazione.kml
Cache-Control: private
Content-Type: application/vnd.google-earth.kml+xml kml; charset=utf-8
Content-Length: 1001
Connection: Close

This is from my development server, using IIS:
HTTP/1.x 200 OK
Date: Fri, 15 Sep 2006 09:37:58 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
content-disposition: attachment; filename=Localizzazione.kml
Cache-Control: private
Content-Type: application/vnd.google-earth.kml+xml kml; charset=utf-8
Content-Length: 969

And this is an example (from dev IIS) if I restore the content disposition
value to inline:
HTTP/1.x 200 OK
Date: Fri, 15 Sep 2006 09:42:14 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
content-disposition: inline; filename=Localizzazione.kml
Cache-Control: private
Content-Type: application/vnd.google-earth.kml+xml kml; charset=utf-8
Content-Length: 969

I cannot find any interesting difference.
From dev server, IE open GE. From production, it still shows data as
standard xml in IE itself :(((


Sep 15 '06 #6
Hi Trapulo,

Thanks for your followup.

This does sound a bit strange though we can get that install the GE on the
server will make the things work, yes?

Anyway, I'll ask some other IIS or ASP.NET engineers to see whether they
have any ideas on this. I'll update you if I get any further information on
this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Sep 19 '06 #7
Hi Trapulo,

Just post this message you inform you that I'm still waiting for some
information from other product team engineer. I'll update you as soon as I
get any new feedback.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Sep 21 '06 #8
Thank you.

Hope they can help us.
"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:pS**************@TK2MSFTNGXA01.phx.gbl...
Hi Trapulo,

Just post this message you inform you that I'm still waiting for some
information from other product team engineer. I'll update you as soon as I
get any new feedback.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.

Sep 21 '06 #9
Hi Trapulo,

Sorry for keep you waiting. I've just got some further feedback from some
other product team engineer. However, they also think this could be some
mime-type settnig that Google earch will register it on the machine when
being installed. Here is the original message from some IIS experts:

=====================
it sounds as if Google Earth is adding a file extension assocation to the
client and then mapping the MIME type to that file extenstion and therefore
Google Earth

when receiving a response IE will refer to this list to determine if the
content needs to be passed to another application

you can check the file assocations through Windows Explorer in the Tools,
Folder Options, File Types menu

it looks as if the MIME type to file extension mappings are stored in the
registry
http://support.microsoft.com/kb/302002/en-us

you should therefore be able to search the registry for
application/vnd.google-earth.kml which should link to a file extension and
then confirm that this file extension is mpaped to Google Earth

not sure how you would override this though as you are using Google Earh
MIME type which would reasonably be expected to link to Google Earth
======================

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.
Sep 25 '06 #10
Hello again Steven,
in fact I found that I have a ".kml" key in the registry of development
server. However, I've tried to create it on production server also, then I
restarted IIS, but it's still the same behavior :(

I also found a key in
HKEY_CLASSES_ROOT\Mime\Database\Content
Type\application/vnd.google-earth.kml+xml
I exported it and imported in production server, restarted IIS, but still
same.

It seems that IE WANTS to open the kml as an XML, despite of all other MIME
commands... :(
"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:eF**************@TK2MSFTNGXA01.phx.gbl...
Hi Trapulo,

Sorry for keep you waiting. I've just got some further feedback from some
other product team engineer. However, they also think this could be some
mime-type settnig that Google earch will register it on the machine when
being installed. Here is the original message from some IIS experts:

=====================
it sounds as if Google Earth is adding a file extension assocation to the
client and then mapping the MIME type to that file extenstion and
therefore
Google Earth

when receiving a response IE will refer to this list to determine if the
content needs to be passed to another application

you can check the file assocations through Windows Explorer in the Tools,
Folder Options, File Types menu

it looks as if the MIME type to file extension mappings are stored in the
registry
http://support.microsoft.com/kb/302002/en-us

you should therefore be able to search the registry for
application/vnd.google-earth.kml which should link to a file extension and
then confirm that this file extension is mpaped to Google Earth

not sure how you would override this though as you are using Google Earh
MIME type which would reasonably be expected to link to Google Earth
======================

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no
rights.


Sep 25 '06 #11
Thanks for your reply Trapulo,

That does be abit strange. So currently you can only install Google Earth
on the server machine to make it work but haven't any other means to
manually duplicate the configuration Google Earch does? Can you confirm
the behavior on some other test server? If this does be a common issue, I
would suggest you consider contact CSS for further troubleshooting on this.
So far what I can get are limited to the client-side file type mappings
and the server-side mime-type mappings.
Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Sep 27 '06 #12

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

Similar topics

3
by: Gary | last post by:
I am having a strange problem that I cannot solve. I have an asp page that I use for a user to login and gain access to other pages. When the user logs in I set a couple of session variables like...
9
by: Dominic Godin | last post by:
Hi, I have an asp page that does a lot of processing and reports it's finished by printing the word "Success". For example: <% SomeFunction(SomeVar) SomeFunction(SomeVar1) ...
13
by: TinyTim | last post by:
I'm a newbie at ASP & HTML. It seems that when you use server side code and you're going to return a customized HTML form with several fields and labels, you have to do an extensive amount of...
6
by: Mark | last post by:
Hi... I've come across some weird bug with Response.Cookies. Or maybe it will be called "by design" but for the life of me I can't figure out what purpose it would serve. If you're setting a...
5
by: Luiz Vianna | last post by:
Guys, I need to send some info to my client while I'm processing some stuff. The flow will be something like : -process -response -process -response .... I imagine to use response.flush...
2
by: David Union | last post by:
Hi. I'm posting this here because I don't know exactly what the best group is. This is for an aspx page with Visual Basic as the code-behind page. I am doing very simple code... in the middle...
7
by: Shapiro | last post by:
I have a scenario where I log a resquest to a database table and update the request with a corresponding response including the response time. I am using an HttpModule to do this. My challenge...
0
by: PD | last post by:
I am trying to stream out a PDF file via the response object and when I execute the code it always brings up the first document that I pulled up.Even when I step through the code, I can see the new...
6
by: john | last post by:
The standard method to transmit a file from an aspx page to a browser is to stream the file to the response then end the response. The HTML code generated by the aspx page is discarded, and the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.