Let me explain better than what the question state. I dynamically generate a KML file from an aspx page and use routing to change the url so I can access myapp.com/mykml.kml and the download starts. I use Response.write() in the aspx page to send the data and it work flawlessly. But there is a zipped version for KML files which is KMZ and I am wondering if I can still use my aspx page to serve a KMZ instead of a KML. Since I do not use a file I cannot "zip" it. Is there a way to zip the stream and output it in the Response.Write()?
+1
A:
Yes, you can: ASP.NET - Create Google Earth .kmz files dynamically using in-memory streams and #ziplib
Rubens Farias
2010-01-21 10:38:50
Well wasn't expecting this to have a blog entry somewhere. Sorry I didn't search better. Blog entry talk about impossibility to do it witout a library. Does .NET 3.5 have the ability to PKZip?
lucian.jp
2010-01-21 10:46:43
Yes and No. You can use System.IO.Packaging to create a zip file, but it will lead to insomnia, headaches, nausea, and hair loss. Better to use a 3rd party library.
Cheeso
2010-01-22 02:21:12