views:

94

answers:

1

I create a file in JavaScript. Now I want to be able to make it available to the user as a download is this possible?

To be exact it is a KML File I create so its basic XML.

+1  A: 

no. Not sipmly with JavaScript.

What determines the browser to automatically prompt you for saving a file, instead of trying to display it, is its MIME type. And only the server can set the MIME time as it is part of the header of the response.

Of course, if you use JS on the server (with Jaxer or another engine), it's another story...

gizmo