0

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?

1 Answers1

1

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

http://filext.com/faq/office_mime_types.php.

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

Karolis T.
  • 2,709
  • 7
  • 32
  • 45