I have a web page that will be used to create KML Files with a perl script.I want the user to add some data to a form that will be used in my perl script. When the form is submitted it will run the script, create a kml file, then prompt the user to save the file. The only part I am not sure about is how to have the user save the file after the script has created the KML. Do I have the perl script prompt the download or use something on the HTML page prompt the download. I am not sure the best way to do this.
Share
If you have a link or a form for telling the server to build the KML then just generate the KML normally and send it back to the browser with some extra HTTP headers. The headers you want are:
Content-dispositionset toattachment;filename=whatever.kmlwhere “whatever.kml” is what you want the file to be called.Content-typeset toapplication/vnd.google-earth.kml+xml.The
Content-dispositionshould tell the browser to download the KML instead of trying to handle it.So the Perl script will be prompting the browser to prompt the download.