1

I am trying to send a file via send_file, in rails 3... The file is found and is seemingly sent too, but for some reason it is not received...

Also even though :disposition => 'inline' is set, the browser always shows a "download box"...

In nginx conf, sendfile is set to on...

Amit
  • 3,952
  • 7
  • 46
  • 80

2 Answers2

0

I suggest you should go through this: Serving Large Files Through Nginx via Rails 2.3 Using x-sendfile

Community
  • 1
  • 1
Vicheanak
  • 6,444
  • 17
  • 64
  • 98
0

I had the same problem, I looked at the response headers and saw the response type was being set as application/octet-stream. Try setting the file's mime type when calling send_file

send_file file, :disposition => 'inline', :type => 'image/png'

Marcel M.
  • 2,376
  • 2
  • 18
  • 24