Opening MS word document in browser
843836Jul 14 2004 — edited Jul 15 2004Hello,
We have documents stored in docbase (a database specilaizing in storing documents). Using the unique id, we can identify the documents.
Now my job is to open the documents in a browser, based on the unique obj_id of the document. I have written a servlet code, that does the above, but with a bug.
I have response.setContentType("application/pdf") for pdf files and ("application/msword") for MS word files.
When I execute my servlet, pdf files open correctly. But if its a word document, rather than opening it in a browser, it prompts the user to either "OPEN" or "SAVE" or "Cancel". (like the window that pops up when we normally try to download something from the internet)
ANy idea why this window pops up for MS word documents alone? When I click "open" the browser opens with the right contents. Similiarly, when I click "save" and then open the saved document, then also the browser opens with the right contents.. however is there some way I can make the word document open directly in a browser (like how pdf and other file types open) without prompting for user input?
response.setContentType("application/msword") -> Is there someother way of setting content type for a MS word document?
Or is something wrong with my IE setting? We have Win 2000 and IE 6.0