2

How to create a xml file on the client machine using javascript or jquery. I need to write the xml file on the clients machine from my web application using javascript or jquery. How can i do so? and need it for atleast 3 browsers Firefox,Chrome and IE8+

3
  • 1
    you can create the file on server and make it downloadable for the client Commented Sep 6, 2011 at 12:26
  • Actualy here is described how to use jQuery for creating XML content. But I'm not sure if it's possible to write it to the file. Commented Sep 6, 2011 at 12:29
  • Thanks for the answer but actually i need it to let my application work offline, and i dont need my data to be lost by clearing cache, so cannot use html5 Commented Sep 6, 2011 at 12:42

2 Answers 2

1

Creating files on the client side is not well supported in many browsers. The trick is to generate a string containing your XML, then encode it using base64 encoding, and redirect the browser to a data: URL which contains this base64 encoded data.

It is easier to create your file on the server and let the user download it.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the answer but actually i need it to let my application work offline, and i dont need my data to be lost by clearing cache, so cannot use html5
1

We can use signed applet to write any file on the client side using your application. This is one of the best solution i have got till now.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.