| Author |
Problem in opening a RTF File
|
Vicky Mohan
Ranch Hand
Joined: Oct 14, 2004
Posts: 130
|
|
Hey All, I am trying to open a RTF file and provide the option to open or save for the user. The problem i am having is, somehow the file shows up with the extension .do and does not recognize the file type. Any thoughts why this is happening. I am guessing that the FILE TYPE is not getting recognized correctly . response.setContentType("application/rtf"); response.setHeader("Content-disposition","attachment;file="+ filename); Any suggestion will be appreciated
|
 |
Dave Wingate
Ranch Hand
Joined: Mar 26, 2002
Posts: 262
|
|
I've had this problem too. From what I can tell, most browser plugins will use the last bit of the request URL as the default "save as" file name. A possible way to work around this is to provide the file name you want used for the "save as" action as the last bit of the query string: e.g. MyAction.do?filename=mydoc.rtf I don't remember if this works. If not, you'll have to change the request URL to just mydoc.rtf and then configure your web app to forward all requests ending in .rtf to a particular servlet (i.e. MyAction.do).
|
Fun programming etcetera!
|
 |
 |
|
|
subject: Problem in opening a RTF File
|
|
|