Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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

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

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

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

Your Answer

 
discard

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