I'm sending a ms-word file using rails. i.e when I click on a link, a doc file from tmp folder (in project) is sent.
The code I'm using is
@filename ="#{RAILS_ROOT}/tmp/test/test.doc"
send_file(@filename ,
:filename => "test",
:type => 'application/msword',
:disposition => 'attachment',
:streaming => 'true',
:buffer_size => '4096')
It's working, but it's sending an empty file. Content is missing in the file. Any suggestions?