Could not open file xxxxx for reading ERROR

1,238 views
Skip to first unread message

spf_10000

unread,
Sep 4, 2005, 8:18:55 PM9/4/05
to KML Discussions
I've looked in all the places I could think of on this BBS and Googling.

Whenever I click on a KMZ link on the BBS or inside Google Earth Plus, the file downloads from the internet and then I get that error. I'm pretty sure the problem is with Internet Explorer (I'm using 6.0.2800....) and I've tried changing option settings with no success.

If I click on the link in Firefox, then it loads in Google Earth Plus fine. BUT, since the app uses IE internally, all those nice placemarks that are linked to attachments gives the same errors.

Anyone have any ideas how to get the KMZ links inside Google Earth Plus to load correctly?

Thanks for any help.

Steve
Tucson, AZ

ocw001

unread,
Nov 29, 2005, 2:34:52 AM11/29/05
to KML Discussions
Dear All

I am in real estate and am trying to create a kml link to link properties on my site to locations on google earth using lat/longs.

I keep getting an error saying "could not open file XXXXXX for reading"

I have looked at a number of forums with some answers but none seemed to work.

I have tried changing the http expiry from immediately to one minute with no success

It works fine on firefox! and it works ok when i save it on IE then open it!

Anyone have any ideas?

Cheers

Col

JuanLiska

unread,
Aug 21, 2006, 3:46:01 PM8/21/06
to KML Discussions
I have had the exact same problem. If someone has encountered this and solved it, please post your solution to this topic, as it's very difficult to find one on the web/google.

tekgergedan

unread,
Aug 21, 2006, 4:05:08 PM8/21/06
to KML Discussions
Hi

Please check "Show Results in External Browser" box in GE's Options window to bypass the built-in browser. This error is related to IE and you seem to have a local problem with it.

If IE as external browser still doesnt load and you cant fix it, you'd better to set another browser to default.

PenguinOpus

unread,
Aug 23, 2006, 10:13:49 AM8/23/06
to KML Discussions

If you IE disk cache is full, then that might explain what you are seeing. I have noticed that Internet Explorer does _not_ use LRU (least recently used) algorithm and it will delete the last file it downloaded before the external application can find it. Hopefully they'll fix this in IE7, but clear your IE disk cache.

shuiniu

unread,
Oct 19, 2006, 10:25:01 AM10/19/06
to KML Discussions
Google Earth only support english path, can't support other language path
you may change KML file path , that maybe ok.

tekgergedan

unread,
Oct 19, 2006, 11:00:35 AM10/19/06
to KML Discussions
Welcome shuiniu,

Downloads are first stored in a temporary folder and, then, it is forwarded to the application. As Penguin told, IE removes the last file in that folder if its cache is full. Therefore, spf_10000 was able to download the files when using Firefox instead of IE.

CayenneX5

unread,
Oct 23, 2006, 10:58:28 AM10/23/06
to KML Discussions
Hi guru:
I have same issue, and I think is is not about cache of IE, I clear IE cache, it is not work also.
The same thing happend when I double click a .kmz or .kml file, nothing happend about GE.

tekgergedan

unread,
Oct 23, 2006, 11:17:15 AM10/23/06
to KML Discussions
My reply is true if it opens with other browsers. There is a fine difference between cases. But, again, it is not related with double-clicking, either.

Double-clicking problem is related to the file associations of the OS.

dvmorris

unread,
Oct 30, 2006, 4:05:09 AM10/30/06
to KML Discussions
has anyone figured out any other reason for this error? I am having the exact same problem on my site, serving up kml via a php script in internet explorer.

it works to save the file first, then open it, but if you just open the file directly from ie, google earth gives the could not read file error mentioned above... i've tried the suggestions and nothing seems to change. thanks for the help,

dvmorris

unread,
Oct 30, 2006, 4:10:37 AM10/30/06
to KML Discussions

Bruno_Bowden

unread,
Oct 31, 2006, 2:42:12 AM10/31/06
to KML Discussions
SPF or anyone else, can you provide a little more information.

1) When you get the "could not load" error can you give the full message including the location of the file that's failing to load.
2) Does that file exist on the hard disk.
3) What other files are in the same folder of the file failed to load (look at the most recent files)
4) Did deleting the cache work?

tekgergedan

unread,
Nov 1, 2006, 3:25:59 PM11/1/06
to KML Discussions
The main thread with Cayenne's problem (not opening by double-clicking without any error prompt) is this:
http://bbs.keyhole.com/ubb/showflat.php/Cat/0/Number/655279/

Cayenne has solved the problem but we still dont know what the problem was.

mooreds

unread,
Nov 19, 2006, 6:54:14 PM11/19/06
to KML Discussions
Hi,

I am encountering the same issue. FF1.5 downloads a generated kml/kmz file and opens it in Google Earth just fine. IE chokes on a generated kml or kmz file (size doesn't seem to matter very much, I got the erro on 500 point and 1 point files), but does fine if you:
* use IE to download a pregenerated kmz file
or
* download the file and save it to disk, then view it in Google Earth.

The exact error message I get is
"Could not open file C:\DOCUME~1\Dan\LOCALS~1\TEMPOR~1\Content.IE5\IJOLA5U7\KML_1_~1.KML for reading"

When I set the content-disposition header to foo.kml I get this error:
"Could not open file C:\DOCUME~1\Dan\LOCALS~1\TEMPOR~1\Content.IE5\IJOLA5U7\FOO_1_~1.KML for reading"

I have found that directory and do not see any kml files in there. I have cleared my IE cache, which empties that folder (except for the page I am currently on) and still get the same error message. I also tried clearing my google earth cache and didn't see any change in behavior.

I am using IE 6.0.29 on Windows XP SP2.

Other files that are in the same directory include gif, jpg, png, js, and kmz files. They all have [#] just before the suffix.

It really seems to be an issue with IE because I am also generating a .xls file and got the same error.

I think I answered all the questions you posed, Bruno.

Thanks,
Dan

Bruno_Bowden

unread,
Nov 20, 2006, 1:20:29 AM11/20/06
to KML Discussions
Hopefully the link that tekgergedan might have some ideas. This sounds like a problem in IE rather than Earth. Please let me know if you work it out.

ManoM

unread,
Nov 20, 2006, 11:31:24 AM11/20/06
to KML Discussions
Hi Dan,

Does this happen to files posted here on the bbs? Or is it something specific to only certain files? If it is specific to those files, can you provide us a link so we can see if we get the same error?

Thanks,
ManoM

Roy_lit

unread,
Nov 26, 2006, 10:22:40 PM11/26/06
to KML Discussions
Ok, it looks like a lot of you are have the same problem, me too, if I loaded a kml file directly to IE, it would choke, FireFox and the other browsers were good to go. After about 4 hours of testing, I got it working with all of the browsers.

I am not sure this is the answer for everyone, but it was for me. I am using PHP and mysql to create an 'on-the-fly' kml file. I use sessions to pass things from one screen to the next which requires me to do a session_start() at the start of my file. Once I took the session_start() out, IE would work.

I haven't tried to figure out why yet, I am just happy to have things working :-)

The easiest way I found to test this was to build a small kml file with just the headers and one GE location, nothing else, then see if you can get it into GE. If you can, just start building your code from there.

Let me know if this helps.

ManoM

unread,
Nov 27, 2006, 4:07:53 AM11/27/06
to KML Discussions
Hi Roy_lit,

Did you try changing your server settings so that the proper MIME types were supported? Check ou the server requirements in the KML 2.0 Tutorial.

ManoM

Roy_lit

unread,
Nov 28, 2006, 7:27:53 AM11/28/06
to KML Discussions
ManoM,
Maybe I wasn't clear in my previous post.... I don't have a problem.

I am producing on-the-fly KLM files to all browsers including IE.

I posted this as a possible solution for Dan and some of the others. It seems no one has posted a fix..... just guesses to what they think the problem could be.

mooreds

unread,
Dec 7, 2006, 11:34:43 AM12/7/06
to KML Discussions
Hi folks.

So, I am in the same situation as Roy_lit, where I am generating a KML file from a SQL query with PHP. I also was generating an excel csv and getting similar error messages. (So, no, I wasn't having trouble with the kml files on this bbs).

Disabling sessions fixed the problem, as Roy_lit said it would. Unfortunately, my application depends on sessions, so this is not a viable solution.

A bit more sleuthing and reading this page led me to another solution: turn off the caching headers in php. This is done (in php 5) via the session.cache_limiter property in php.ini. Mine was set to nocache, but when I deleted that value, I had no problems with downloading KML files with Internet Explorer.

Thanks everyone for the suggestions and help.
Dan

Roy_lit

unread,
Dec 12, 2006, 8:33:33 PM12/12/06
to KML Discussions
Dan,
Thanks for your post, I really wanted to use sessions but could not figure it out.
I followed your advise, (I am using PHP 4.3) I put session_cache_limiter('public'); then session_start();
and everything works great.

You da man!!

Swii

unread,
Jan 3, 2007, 1:01:42 PM1/3/07
to KML Discussions
I know people have found work-arounds for this problem, but I believe I have found the cause, which should give you non-PHP users some more options.
First, the error message that Google Earth gives you is absolutely right. The reason the file cannot be opened for reading is because the file does not exist.

This appears to be a bug in IE in the way they implement their caching strategy. When the browser follows a certain URL, the response is cached on the file system. The cached content will remain on the file system until it expires.

In the cases where this error occurs, it appears the server is telling the browser not to cache the response (which is the KML file). When Google Earth looks for it, it isn't there! Now Firefox and earlier versions of IE handle this successfully, but "new" IE (6 and later?) appears to do the following:

1. Download KML as HTTP response
2. Recognize MIME type as Google Earth related
3. Start Google Earth, passing the cache path to the KML file (which doesn't exist!)
4. Google Earth starts up and chokes.

FIXES:

1. Enable client caching (simple, but may not be feasible in your app)
2. Enable caching, but expire the cached content after a few seconds

3. *BEST*: Enable caching, then ensure that the URL for each request is unique (can do this by appending a timestamp or similar method)

This worked for us, good luck!

fuji8bit
Reply all
Reply to author
Forward
0 new messages