0

Possible Duplicate:
Is it possible to display an RTF file inside a web page using PHP?

I would like to display .doc files inline on page.
I try to use send_file method in my controller action:

    mime_types = {
        :doc => 'application/msword',
        :docx => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
        :pdf => 'application/pdf',
        :rtf => 'application/rtf',
        :jpg => 'image/jpeg',
        :tiff => 'image/tiff'
    }

    send_file 'c:/sites/efiling2/test.rtf', 
        :filename => '2', 
        :type => mime_types[:doc], 
        :disposition => 'inline'

For pdf files it works, but for doc files browser asks me to open file in Word or to save it on dics.

Is it possible to open doc files inline on page?

Community
  • 1
  • 1
Lesha Pipiev
  • 3,251
  • 4
  • 31
  • 65
  • http://stackoverflow.com/questions/678192/is-it-possible-to-display-an-rtf-file-inside-a-web-page-using-php – RadBrad May 02 '12 at 18:44

1 Answers1

0

the problem is that your browser is not able to view the word doc file thats why its offering you to save it. I would suggest you look into some HTML document viewers. take a look at http://www.documentcloud.org/opensource

Yuriy Goldshtrakh
  • 2,014
  • 1
  • 11
  • 7