Thanks to the forum, I now have my kml and gpx files automatically downloading rather than displaying as text in the browser…
but! I have another problem that I'm not getting any closer to solving - so it's back to the forum for help!
Lets say I have a page at a URL like /building/library/
…and I have my design that delivers the data as a kml download
so that when I view /building/library?SQ_DESIGN_NAME=kml it downloads the correctly formatted data.
All good so far!
However when I try to open the file automatically, the OS spits the dummy because the downloaded filename is just "library", it hasn't attached the correct file extension (in this case .kml).
I realise I could create a second web path to the file and add the extension in manually when I build the link to the kml version, but I want this to happen automatically - and that just sounds like a whole lot of unmaintainable pain.
Any ideas? I'm sooo close!!
You can use Apache Mod Rewrite for this. You would re-write the url:
RewriteRule ^/(.*)\.kml$ $1?SQ_DESIGN_NAME=kml
RewriteRule ^/(.*)\.gpx$ $1?SQ_DESIGN_NAME=gpx
That's completely untested, but hopefully on the right track. Then you could use something like /building/library.kml to show the kml design of a page.
[quote]
Thanks to the forum, I now have my kml and gpx files automatically downloading rather than displaying as text in the browser…
but! I have another problem that I'm not getting any closer to solving - so it's back to the forum for help!
Lets say I have a page at a URL like /building/library/
…and I have my design that delivers the data as a kml download
so that when I view /building/library?SQ_DESIGN_NAME=kml it downloads the correctly formatted data.
All good so far!
However when I try to open the file automatically, the OS spits the dummy because the downloaded filename is just "library", it hasn't attached the correct file extension (in this case .kml).
I realise I could create a second web path to the file and add the extension in manually when I build the link to the kml version, but I want this to happen automatically - and that just sounds like a whole lot of unmaintainable pain.
Any ideas? I'm sooo close!!
[/quote]
You can set web paths in triggers, using keywords, so hopefully you can make that happen automatically using that?
[quote]
You can set web paths in triggers, using keywords, so hopefully you can make that happen automatically using that?
[/quote]
Wouldn't it be simpler to just link to the assetid with the .kml on the end, e.g. "./?a=123.kml".
Assuming Anthony's trick works (which I think it might, but also haven't tested it) I think linking with .kml on the end (also untested) should work.