clops
clops

Reputation: 5255

JavaScript Output to a File

I am creating quite a bit of XML with JavaScript which is then processed by variuos components. I would like to send this XML to some file and prompt the user to save it on their disk (all this happens in the browser at the client, no server interaction whatsoever). Is this at all possible? Google is not a lot of help here :(

Upvotes: 1

Views: 2231

Answers (2)

Christian C. Salvadó
Christian C. Salvadó

Reputation: 828050

Give a look to Downloadify, is a tiny JavaScript + Flash library that enables the creation and download of text files without server interaction.

Upvotes: 1

Chuck Vose
Chuck Vose

Reputation: 4580

Javascript's sandbox policy restricts writing to the filesystem so you'll have to use an installed program or ActiveX in the case of your IE users (the one time IE does something extra that you need :P).

EDIT: If you can use a server you could write the file there then prompt the user to download it.

Upvotes: 0

Related Questions