Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

send_file just sends an empty file

Im looking for a way to download a xml file. I use:

file_path = 'folder/' + xml_name + '.xml'
send_file file_path, :type => "text/xml"

but this always downloads me an empty file. The file itself has 16 KB of data in it...

why is that?

Maechi

like image 426
Markus Avatar asked Aug 11 '10 07:08

Markus


1 Answers

probably you have to comment out

config.action_dispatch.x_sendfile_header = "X-Sendfile"

in production.rb

see http://vijaydev.wordpress.com/2010/12/15/rails-3-and-apache-x-sendfile/ for explanations

like image 78
Eugene Avatar answered Sep 19 '22 18:09

Eugene