Discussion Locked

download Word document with JavaScript

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I want to enable my clients to download a word application form from my website. I want to use JavaScript or simple html (not cgi). Is this possiblea nd if it is, how? I want the download dialog box to appear so that users chose to open or save it locally. Please help

2 replies

by jay eckles

You're going to have to do something on the server side if you want to attempt to make a download dialog box appear. One thing you could do is configure your webserver so that the mime type of any document ending in .doc is application/octet-stream. If you use a CGI program to fetch the word docs, you can set the content-type dynamically and you can suggest a name for the file being downloaded.

My suggestion is that you just provide hyperlinks to the Word documents on your server. If people want to save it, they can either click the link then use the Word menus or, if they're using Windows and IE, they can right click on the link and save the target. Almost all browsers on all platforms have some provision for saving the target of alink.

Trust the users. They know how to use their software.

Good luck.

Jay

This discussion is closed to new replies.