Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am helping someone out with a javascript-based web app (even though I know next to nothing about web development) and we are unsure about the best way to implement a feature we'd like to have.

Basically, the user will be using our tool to view all kinds of boring data in tables, columns, etc. via javascript. We want to implement a feature where the user can click a button or link that then allows the user to download the displayed data in a .doc file.

Our basic idea so far is something like:

  • call a Java function on the server with the desired data passed in as a String when the link is clicked
  • generate the .doc file on the server
  • automatically "open" a link to the file in the client's browser to initiate the download

Is this possible? If so, is it feasible? Or, can you recommend a better solution?

share|improve this question
up vote 1 down vote accepted

Store the .doc file locally only if you need it for later reference. Otherwise, you can just output the data directly to the browser with appropriate mime-type headers attached

From the sound of it, this would be more suited for

share|improve this answer
good call on stackoverflow, gonna crosspost it over there – user9812 Jun 17 '09 at 11:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.