0

In my Rails (2.3.10). I found some weird issue. My application needs to download a XML file when a user hit the downloaded URL.

For example :

http://www.example.com/test/all.xml

The problem here is, If I hit the url with alias name (http://www.example.com/test/all.xml). the XML not get downloaded.

If I hit production direct URL like http://xx.xx.xx.xx:3000/test/all.xml . The XML started downloading without any problem.

Can any one help on this. ? Please

Here is my code in Test controller :

def index     
  file_path="/tmp/all.xml"    
  send_file file_path, :type => 'text/xml; charset=utf-8'    
end

I have placed the "all.xml" file into my production server /tmp/all.xml.

I am using Jruby(1.6.5) and a WAR file is deploying to Tomcat....

palani
  • 4,661
  • 8
  • 31
  • 36
  • What does "the XML not get downloaded." mean? Any error messages? What does your log file say? Also try adding `:disposition => 'attachment'` to the `send_file` line. – Anand Shah Jan 24 '13 at 08:47
  • Anand Thanks for your reply.... let me try and let you know – palani Jan 24 '13 at 09:20
  • Anand, the prob still there .eventhough i added :disposition => 'attachment'. Does it related to Buffer size. My Xml size is 165MB – palani Jan 24 '13 at 10:05

1 Answers1

0

so production is running on port 80, but the application server is running on port 3000. What server is doing the redirect. I'd look to the configuration of that server.

Gregory Ostermayr
  • 1,123
  • 10
  • 17