aspose file tools
The moose likes Java in General and the fly likes Problem in opening a RTF File Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Problem in opening a RTF File" Watch "Problem in opening a RTF File" New topic
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!
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Problem in opening a RTF File
 
Similar Threads
RTF to PDF Conversion
Convert Word document to XML
Coverting PDF to DOC
RTF Tool
How to update an RTF template file in java?