ruby-on-rails-4aws-sdkdragonfly-gem

Display ".doc" ".docx" in browser


My users can upload their CV and this CV should be seen by any employer.

My problem is that my client want this CV to appear in the web browser without any download.

PDF work fine but doc & docx don't.

I've tried to use both gem ("docx" and "doc_ripper") but each one can just handle basic thing (table won't work ...)

The cv is attached to one user and stored on Amazon with Dragonfly

I've try the google view : http://googlesystem.blogspot.be/2009/09/embeddable-google-document-viewer.html

But as I do : user.cv_file.remote_url(expires: 5.minutes.from_now) The url doesn't work anymore (this solution only work if the document is public)

I thought to make a second field which have the cv_file convert as a pdf if it's not.

Any possibilities to give a public permission to aws file for 2-3 min (time to render it with google view tool)

Thanks.


Solution

  • Thanks for answering but after many research, I finally found :

    https://view.officeapps.live.com/op/view.aspx?src=

    which work as well as the pdf reader from browser.

    Be sure to have a public url for the file you want to display