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

KML file appears as aspx when served

I have a .Net C Sharp page (aspx) serving up as a .kml file. On my localhost
and an internal test server the page serves correctly and opens Google
Earth. On my production server, I am served the aspx file.

I don't have kml in the MIME types on any of the servers and was wondering
what the difference could be and where I might need to look for differences
in the servers? (The production and test servers are on Win2003 and my
localhost XPsp2)

I am changing the header to
Response.ContentType="application/vnd.google-earth.kml+xml kml";

Response.AddHeader("Content-Disposition","inline;filename=location.kml");

and outputting the following

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.0">
<Placemark>
<name>Casualty Location for PRESTIGE</name>
<visibility>1</visibility>
<description>

</description>
<LookAt>
<longitude>-9.85000000</longitude>
<latitude>43.01666667</latitude>
<range>50000</range>
<tilt></tilt>
<heading>0</heading>
</LookAt>
<styleUrl>#khStyle651</styleUrl>
<Point>
<extrude>1</extrude>
<altitudeMode>relativeToGround</altitudeMode>
<coordinates>-9.85000000,43.01666667,0</coordinates>
</Point>
</Placemark>
</kml>

Cheers!
Mar 24 '06 #1
2 3576
Simon wrote on Fri, 24 Mar 2006 10:04:50 -0000:
I have a .Net C Sharp page (aspx) serving up as a .kml file. On my
localhost and an internal test server the page serves correctly and opens
Google Earth. On my production server, I am served the aspx file.

I don't have kml in the MIME types on any of the servers and was wondering
what the difference could be and where I might need to look for
differences in the servers? (The production and test servers are on
Win2003 and my localhost XPsp2)

I am changing the header to
Response.ContentType="application/vnd.google-earth.kml+xml kml";

Response.AddHeader("Content-Disposition","inline;filename=location.kml");


Have you tried enclosing the filename in quotes, as per the RFC?

Response.AddHeader("Content-Disposition","inline;filename=""location.kml""");

There are also apparently at least six possible variants depending on the
browser version:

http://www.aspfaq.com/show.asp?id=2129

You might want to experiment with a few till you find the right one. Also,
it's possible that there is a difference in the way IE handles sites in the
Intranet/Trusted Sites Zones and the Internet Zone. Try adding your
production server URL to the Trusted Sites zone - if it works then IE
doesn't like the inline; for Internet Zone downloads, you might have better
luck with trying attachment; instead.

Dan
Mar 24 '06 #2
Daniel Crichton wrote:
Simon wrote on Fri, 24 Mar 2006 10:04:50 -0000:
I have a .Net C Sharp page (aspx) serving up as a .kml file. On my
localhost and an internal test server the page serves correctly and
opens Google Earth. On my production server, I am served the aspx
file.
There are also apparently at least six possible variants depending on
the browser version:

http://www.aspfaq.com/show.asp?id=2129

You might want to experiment with a few till you find the right one.
Also, it's possible that there is a difference in the way IE handles
sites in the Intranet/Trusted Sites Zones and the Internet Zone. Try
adding your production server URL to the Trusted Sites zone - if it
works then IE doesn't like the inline; for Internet Zone downloads,
you might have better luck with trying attachment; instead.

Thanks for the pointers, Dan
Mar 24 '06 #3

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

Similar topics

3
by: David | last post by:
Should you be able to map a any file extension to the ASP.NET dll and have it execute ASP.NET script, just like an .aspx page, when it is requested by a browser. If not, why bother giving us the...
2
by: AAguiar | last post by:
Thanks for your replies. Last week, I continued working with this problem. Trying to reproduce the error, I developed a short example and found that the problem is related to strong name dll. ...
7
by: theyas | last post by:
How can I get my code to NOT display two "Open/Save/Cancel/More Info" dialog boxes when using the "Response.WriteFile" method to download a file to IE I've asked about this before and didn't get a...
8
by: Hilmar Demant | last post by:
Hi, i want to create a simple asp.net-applikation, so i choose new c# project - asp.net-webapplication. After creating the project files on the webserver a message appears: The class file...
5
by: Kikoz | last post by:
Hi all. I assume that if the user uploads a file from aspx page IIS will put all future requests to the same page from other users in a line and all of them will be waiting until this upload...
7
by: TLM | last post by:
I am trying to build a web application that will contain links to files on a users local computer. I am assuming that the files will be in a known location and can display in a browser window. ...
5
by: Dave | last post by:
This is my first .NET project (although I am experienced with VS6 and InterDev). I am simply trying to set up a basic ASPX project and connect to an Access database (following the instructions in...
12
by: Mesan | last post by:
I have a directory in an app I'm building that has access limited to users within a specific role and all aspx pages in that directory are unavailable just as I'd hope but other files (pdfs and...
9
by: Morris Neuman | last post by:
Im working with VS 2005 and trying to use a Hyperlink field in a datagrid to play a wave file that is not located in the website folders but is in a plain folder on the same machine, windows 2003...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.